Q141
Open question#include <stdio.h>
int main()
{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%d\n", 3);
}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
8/8
Page
Pick an option on a question to see the right answer and solution.
Q141
Open question#include <stdio.h>
int main()
{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%d\n", 3);
}Select an option to see the answer and solution.
Q142
Open question#include <stdio.h>
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch)
{
case 1:
printf("1\n");
break;
printf("Hi");
default:
printf("2\n");
}
}Select an option to see the answer and solution.
Q143
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.
Q144
Open question#include <stdio.h>
void main()
{
int i = 0, j = 0;
for (i = 0;i < 5; i++)
{
for (j = 0;j < 4; j++)
{
if (i > 1)
break;
}
printf("Hi \n");
}
}Select an option to see the answer and solution.
Q145
Open question#include <stdio.h>
void main()
{
char *ch;
printf("enter a value between 1 to 3:");
scanf("%s", ch);
switch (ch)
{
case "1":
printf("1");
break;
case "2":
printf("2");
break;
}
}Select an option to see the answer and solution.
Q146
Open question#include <stdio.h>
void main()
{
int i = 0;
while (i < 10)
{
i++;
printf("hi\n");
while (i < 8)
{
i++;
printf("hello\n");
}
}
}Select an option to see the answer and solution.
Q147
Open question#include <stdio.h>
void main()
{
int i = 0;
while (++i)
{
printf("H");
}
}Select an option to see the answer and solution.
Q148
Open question#include <stdio.h>
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++);
printf("%lf", k);
}Select an option to see the answer and solution.
Q149
Open question#include <stdio.h>
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch)
{
case 1:
printf("1\n");
default:
printf("2\n");
}
}Select an option to see the answer and solution.
Q150
Open question#include <stdio.h>
int main()
{
int a = 1;
switch (a)
{
case a:
printf("Case A ");
default:
printf("Default");
}
}Select an option to see the answer and solution.
Q151
Open question#include <stdio.h>
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}Select an option to see the answer and solution.
Q152
Open questionSelect an option to see the answer and solution.
Q153
Open question#include <stdio.h>
int main()
{
int i = 0;
for (i++; i == 1; i = 2)
printf("In for loop ");
printf("After loop\n");
}Select an option to see the answer and solution.
Q154
Open question#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}Select an option to see the answer and solution.
Q155
Open question#include <stdio.h>
void main()
{
int i = 0;
int j = 0;
for (i = 0;i < 5; i++)
{
for (j = 0;j < 4; j++)
{
if (i > 1)
continue;
printf("Hi \n");
}
}
}Select an option to see the answer and solution.