CSE MCQs :: C-MCQs
-
What is the output of this C code?
void main()
{
int k = 0;
for (k < 3; k++)
printf("Hello");
}
-
What is the output of this C code?
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++)
printf("Hello");
}
-
What is the output of this C code?
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++);
printf("%lf", k);
}
-
What is the output of this C code?
void main()
{
int k;
for (k = -3; k < -5; k++)
printf("Hello");
}
-
What is the output of this C code?
int main()
{
int i = 0;
for (; ; ;)
printf("In for loop\n");
printf("After loop\n");
}
-
What is the output of this C code?
int main()
{
int i = 0;
for (i++; i == 1; i = 2)
printf("In for loop ");
printf("After loop\n");
}
-
What is the output of this C code?
int main()
{
int i = 0;
for (foo(); i == 1; i = 2)
printf("In for loop\n");
printf("After loop\n");
}
int foo()
{
return 1;
}
-
What is the output of this C code?
int main()
{
int *p = NULL;
for (foo(); p; p = 0)
printf("In for loop\n");
printf("After loop\n");
}
-
What is the output of this C code?
int main()
{
for (int i = 0;i < 1; i++)
printf("In for loop\n");
}
-
What is the output of the code given below?
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
l1:goto l2;
printf("%d ", 3);
l2:printf("%d ", 4);
}