MCQs
Total Questions : 28
| Page 1 of 3 pages
Answer: Option A. -> Enter a number:99
Question 2. What is the output of given program if user enter "xyz" ?
#include
void main()
{
float age, AgeInSeconds;
int value;
printf("Enter your age:");
value=scanf("%f", &age);
if(value==0){
printf("\\nYour age is not valid");
}
AgeInSeconds = 365 * 24 * 60 * 60 * age;
printf("\\n You have lived for %f seconds", AgeInSeconds);
}
#include
void main()
{
float age, AgeInSeconds;
int value;
printf("Enter your age:");
value=scanf("%f", &age);
if(value==0){
printf("\\nYour age is not valid");
}
AgeInSeconds = 365 * 24 * 60 * 60 * age;
printf("\\n You have lived for %f seconds", AgeInSeconds);
}
Answer: Option C. -> Enter your age: xyz Your age is not valid
Answer: Option B. -> Enter your age: xyz You have lived for 0.00000 seconds
Answer: Option C. -> 10 20 21 10
Answer: Option C. -> 20 20
Answer: Option A. -> -10 to -1
Answer: Option B. -> examveda
Answer: Option C. -> 6 6
Answer: Option D. -> 100 0 100
Answer: Option D. -> Complier error