C Fundamentals - Study Mode

[#281] What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 2
int j = ++i + i
printf("%d
", j)
}
Correct Answer

(A) 6

[#282] What will be the final value of j in the following C code? #include <stdio.h>
int main()
{
int i = 10, j = 0
if (i || (j = i + 10))
//do something
}
Correct Answer

(A) 0

[#283] What will be the output of the following C function? #include <stdio.h>
enum birds {SPARROW, PEACOCK, PARROT}
enum animals {TIGER = 8, LION, RABBIT, ZEBRA}
int main()
{
enum birds m = TIGER
int k
k = m
printf("%d
", k)
return 0
}
Correct Answer

(D) 8

[#284] What will be the output of the following C code? #include <stdio.h>
void main()
{
int k = 8
int m = 7
int z = k < m ? k++ : m++
printf("%d", z)
}
Correct Answer

(A) 7

[#285] What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 2, y = 0
int z
z = (y++, y)
printf("%d
", z)
return 0
}
Correct Answer

(B) 1