Question
Name and age should be entered by the user. You have prepared the following code for this purpose. However, when testing it, you notice that
Name and age should be entered by the user. You have prepared the following code for this purpose. However, when testing it, you notice that errors have crept in. What is wrong? ------------------------- int age; char name[50];
printf("Name: "); scanf("%s", name);
printf("Age: ") scanf("%d", age);
1 : The placeholders in scanf are interchanged 2 : The order of the parameters in scanf is swapped 3 : The address operators in scanf are missing: &name and &age 4 : The address operators in scanf are missing, but only in &age 5 : scanf is the wrong function, it only works for files.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started