Professional Documents
Culture Documents
C Language (Day-04)
C Language (Day-04)
Gorakhpur Center
Ministry of Electronics & Information Technology (MeitY), Government of India
3. What will be the output of the following C 4. What will be the output of the following C
code? code?
#include <stdio.h> #include <stdio.h>
int main() int main()
{ {
int x = 0; int x = 0;
if (x == 0) if (x == 1)
printf("true, "); if (x >= 0)
else if (x = 10) printf("true\n");
printf("false, "); else
printf("%d\n", x); printf("false\n");
} }
a) false, 0 b) true, 0 a) true b) false
c) true, 10 d) compile time error c) Depends on the compiler d) No print
Answer: b statement Answer: d