C Language MCQ - English
What is the output of given program if user enter "xyz" ?
#include
Home | Discussion Forum
What is the output of given program if user enter "xyz" ?
#include
void main()
{
float age, AgeInSeconds;
printf("Enter your age:");
scanf("%f", &age);
AgeInSeconds = 365 * 24 * 60 * 60 * age;
printf("You have lived for %f seconds", AgeInSeconds);
}
Answer : B
Free Online Test
View More Related Question
1) What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x == 0)
printf("inside if\n");
else
printf("inside else if\n");
else
printf("inside else\n");
}
2) What will be the output of the following C code? #include <stdio.h>
int main()
{
if (printf("%d", printf(")))
printf("We are Happy");
else if (printf("1"))
printf("We are Sad");
}
3) What will be the output of the following C code? #include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
4) What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 0;
if (x++)
printf("true\n");
else if (x == 1)
printf("false\n");
}
5) Study the following 'C' program: #include<stdio.h>
What will be the value of a and b on the execution of above program?
void main()
{
static a,b;
while(a> b++)
}