51. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}
#include <stdio.h>
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}
52. The C code 'for(;;)' represents an infinite loop. It can be terminated by . . . . . . . .
53. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0;
for (i++; i == 1; i = 2)
printf("In for loop ");
printf("After loop\n");
}
#include <stdio.h>
int main()
{
int i = 0;
for (i++; i == 1; i = 2)
printf("In for loop ");
printf("After loop\n");
}
54. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
55. What will be the output of the following C code?
#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");
}
}
}
#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");
}
}
}
Read More Section(Control Structures)
Each Section contains maximum 100 MCQs question on Control Structures. To get more questions visit other sections.