Q101
Open question#include <stdio.h>
void main()
{
int i = 0;
if (i == 0)
{
goto label;
}
label: printf("Hello");
}Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
155
Questions
6/8
Page
Pick an option on a question to see the right answer and solution.
Q101
Open question#include <stdio.h>
void main()
{
int i = 0;
if (i == 0)
{
goto label;
}
label: printf("Hello");
}Select an option to see the answer and solution.
Q102
Open question#include <stdio.h>
void main()
{
int i = 0;
if (i == 0)
{
printf("Hello");
break;
}
}Select an option to see the answer and solution.
Q103
Open question#include <stdio.h>
void main()
{
int x = 0;
if (x == 0)
printf("hi");
else
printf("how are u");
printf("hello");
}Select an option to see the answer and solution.
Q104
Open questionSelect an option to see the answer and solution.
Q105
Open question#include <stdio.h>
void main()
{
int i = 0, k;
if (i == 0)
goto label;
for (k = 0;k < 3; k++)
{
printf("hi ");
label: k = printf("%03d", i);
}
}Select an option to see the answer and solution.
Q106
Open question#include <stdio.h>
int main()
{
int i = 0, j = 0;
while (i < 5, j < 10)
{
i++;
j++;
}
printf("%d, %d\n", i, j);
}Select an option to see the answer and solution.
Q107
Open question#include <stdio.h>
void main()
{
int x = 5;
if (true);
printf("hello");
}Select an option to see the answer and solution.
Q108
Open question#include <stdio.h>
int main()
{
int i = 0, j = 0;
while (l1: i < 2)
{
i++;
while (j < 3)
{
printf("loop\n");
goto l1;
}
}
}Select an option to see the answer and solution.
Q109
Open question#include <stdio.h>
void main()
{
int i = 0;
if (i == 0)
{
printf("Hello");
continue;
}
}Select an option to see the answer and solution.
Q110
Open question#include <stdio.h>
void main()
{
double ch;
printf("enter a value between 1 to 2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}Select an option to see the answer and solution.
Q111
Open question#include <stdio.h>
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}Select an option to see the answer and solution.
Q112
Open question#include <stdio.h>
int main()
{
int i = 0;
for (foo(); i == 1; i = 2)
printf("In for loop\n");
printf("After loop\n");
}
int foo()
{
return 1;
}Select an option to see the answer and solution.
Q113
Open question#include <stdio.h>
int main()
{
float f = 1;
switch (f)
{
case 1.0:
printf("yes\n");
break;
default:
printf("default\n");
}
}Select an option to see the answer and solution.
Q114
Open question#include <stdio.h>
int main()
{
int i = 0;
char c = 'a';
while (i < 2)
{
i++;
switch (c)
{
case 'a':
printf("%c ", c);
break;
break;
}
}
printf("after loop\n");
}Select an option to see the answer and solution.
Q115
Open question#include <stdio.h>
int main()
{
int a = 1;
if (a--)
printf("True");
if (a++)
printf("False");
}Select an option to see the answer and solution.
Q116
Open question#include <stdio.h>
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
}
void foo()
{
l1: printf("3 ", 3);
}Select an option to see the answer and solution.
Q117
Open question#include <stdio.h>
void main()
{
char *str = "";
do
{
printf("hello");
} while (str);
}Select an option to see the answer and solution.
Q118
Open question#include <stdio.h>
void main()
{
int i = 0;
for (i = 0;i < 5; i++)
if (i < 4)
{
printf("Hello");
break;
}
}Select an option to see the answer and solution.
Q119
Open questionSelect an option to see the answer and solution.
Q120
Open question#include <stdio.h>
int main()
{
short i;
for (i = 1; i >= 0; i++)
printf("%d\n", i);
}Select an option to see the answer and solution.