CSE MCQs :: C-MCQs
-
What is the output of code given below?
int main()
{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%d\n", 3);
}
-
What is the output of code given below?
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
}
void foo()
{
l1 : printf("3 ", 3);
}
-
What is output of code given below?
int main()
{
int i = 0, j = 0;
while (i < 2)
{
l1 : i++;
while (j < 3)
{
printf("Loop\n");
goto l1;
}
}
}
-
What is the output of code given below?
int main()
{
int i = 0, j = 0;
while (l1: i < 2)
{
i++;
while (j < 3)
{
printf("loop\n");
goto l1;
}
}
}
-
What is the output of the code given below?
int main()
{
int i = 0, j = 0;
l1: while (i < 2)
{
i++;
while (j < 3)
{
printf("loop\n");
goto l1;
}
}
}
-
The output of the code below is?
void main()
{
int i = 0;
if (i == 0)
{
goto label;
}
label: printf("Hello");
}
-
What is the output of this C code?
void main()
{
int i = 5, k;
if (i == 0)
goto label;
label: printf("%d", i);
printf("Hey");
}
-
What is the output of this C code?
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
l1:goto l2;
printf("%d ", 3);
l2:printf("%d ", 4);
}
-
What is the output of this C code?
int main()
{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%d\n", 3);
}