C Fundamentals - Study Mode
[#86] What will be the output of the following C code? #include <stdio.h>
int main()
{
j = 10
printf("%d
", j++)
return 0
}
Correct Answer
(C) Compile time error
[#87] What will be the output of the following C code? #include <stdio.h>
#define MAX 2
enum bird {SPARROW = MAX + 1, PARROT = SPARROW + MAX}
int main()
{
enum bird b = PARROT
printf("%d
", b)
return 0
}
Correct Answer
(B) 5
[#88] What will be the output of the following C code? #include<stdio.h>
enum shyam
{
a=2,b=3.56
}
enum shyam s
main()
{
printf("%d%d",a,b)
}
Correct Answer
(D) Error
[#89] What will be the output of the following C code? #include <stdio.h>
int main()
{
int a[5] = {1, 2, 3, 4, 5}
int i
for (i = 0
i < 5
i++)
if ((char)a[i] == '5')
printf("%d
", a[i])
else
printf("FAIL
")
}
Correct Answer
(D) The program will compile and print FAIL for 5 times
[#90] What will be the output of the following C code? #include <stdio.h>
int main()
{
int y = 10000
int y = 34
printf("Hello World! %d
", y)
return 0
}
Correct Answer
(A) Compile time error