CSE MCQs :: C-MCQs
-
What is the output of this C code?
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
}
void foo()
{
l1: printf("3 ", 3);
}
-
What is the output of this C code?
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 this C code?
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 this C code?
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 x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
-
The output of the code below is?
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}
-
Comment on the following code below?
void main()
{
int x = 5;
if (true);
printf("hello");
}
-
The output of the code below is?
void main()
{
int x = 0;
if (x == 0)
printf("hi");
else
printf("how are u");
printf("hello");
}
-
The output of the code below is?
void main()
{
int x = 5;
if (x < 1);
printf("Hello");
}
-
The output of the code below is(when 1 is entered)?
void main()
{
double ch;
printf("enter a value btw 1 to 2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}