Control Structures - Study Mode
[#71] What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 0
if (x++)
printf("true
")
else if (x == 1)
printf("false
")
}
Correct Answer
(B) false
[#72] What will be the output of the following C code? #include <stdio.h>
int main()
{
int a = 1
if (a)
printf("All is Well ")
printf("I am Well
")
else
printf("I am not a River
")
}
Correct Answer
(D) Compile time errors during compilation
[#73] What will be the output of the following C code? #include <stdio.h>
int main()
{
printf("before continue ")
continue
printf("after continue
")
}
Correct Answer
(D) Compile time error
[#74] What will be the output of the following C code? #include <stdio.h>
int main()
{
int a = 0, i = 0, b
for (i = 0
i < 5
i++)
{
a++
if (i == 3)
break
}
}
Correct Answer
(D) 4
[#75] What will be the output of the following C code? #include <stdio.h>
switch (ch)
{
case 'a':
case 'A':
printf("true")
}
Correct Answer
(C) if (ch == 'a' || ch == 'A') printf("true")