Control Structures MCQs
Practice free Control Structures multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 155 questions — no login required.
Question 91hard
The C statement ""if (a == 1 || b == 2) {}"" can be re-written as . . . . . . . .
Question 92easy
goto can be used to jump from main() to within a function.
Question 93hard
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");
}Advertisement
Question 94hard
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\n");
else
printf("I am not a River\n");
}Question 95easy
Which keyword is used to come out of a loop only for that iteration?
Question 96hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("before continue ");
continue;
printf("after continue\n");
}Advertisement
Question 97hard
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;
}
}Question 98hard
What will be the output of the following C code?
#include <stdio.h>
switch (ch)
{
case 'a':
case 'A':
printf("true");
}Question 99hard
How many times while loop condition is tested in the following C code snippets, if i is initialized to 0 in both the cases?
while (i < n)
i++;
————-
do
i++;
while (i <= n);