91. The C statement ""if (a == 1 || b == 2) {}"" can be re-written as . . . . . . . .
92. goto can be used to jump from main() to within a function.
93. 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");
}
#include <stdio.h>
int main()
{
int x = 0;
if (x++)
printf("true\n");
else if (x == 1)
printf("false\n");
}
94. 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");
}
#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");
}
95. Which keyword is used to come out of a loop only for that iteration?
96. What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("before continue ");
continue;
printf("after continue\n");
}
#include <stdio.h>
int main()
{
printf("before continue ");
continue;
printf("after continue\n");
}
97. 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;
}
}
#include <stdio.h>
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
if (i == 3)
break;
}
}
98. What will be the output of the following C code?
#include <stdio.h>
switch (ch)
{
case 'a':
case 'A':
printf("true");
}
#include <stdio.h>
switch (ch)
{
case 'a':
case 'A':
printf("true");
}
99. 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);
while (i < n)
i++;
————-
do
i++;
while (i <= n);
100. What will be the output of the following C code?
#include <stdio.h>
#define max(a) a
int main()
{
int x = 1;
switch (x)
{
case max(2):
printf("yes\n");
case max(1):
printf("no\n");
break;
}
}
#include <stdio.h>
#define max(a) a
int main()
{
int x = 1;
switch (x)
{
case max(2):
printf("yes\n");
case max(1):
printf("no\n");
break;
}
}
Read More Section(Control Structures)
Each Section contains maximum 100 MCQs question on Control Structures. To get more questions visit other sections.