Loop Questions and Answers
Practice ModeShowing 10 of 98 questions
Q91
Find the output.
void main ( )
{
char i=1;
for (i;i<127;i++)
printf("Foo1");
}
Answer: Option B
Q92
Find the output.
void main ( )
{
int i=0;
while (!++<5)
{
printf("%d", i);
}
}
Answer: Option D
Q93
Find the output
void main ( )
{
int i=3;
while (i>0]
{
int i=5;
printf("%d", i)
i--;
}
}
Answer: Option D
Q94
Find the output.
void main ( )
int a[3]={7, 5, 9} , b=5, c;
while (b)
{
c=a [b] +b;
b--;
}
printf ("5d", c);
}
Answer: Option A
Q95
Find the output
void main ( )
{
int a=4, b=5, s=0;
while (a+b<15)
{
s+=a+b;
}
printf('5d", s);
}
Answer: Option D
Q96
Find the output
void main ( )
{
int i, j=6;
for (; i=j; j-=2)
printf("5d', j));
}
Answer: Option A
Q97
Find the output
void main ( )
{
int i;
for (i=-5; ~i; i++)
printf("%d", i);
}
Answer: Option B
Q98
Find the output.
void main ( )
{
int x=0;
int y=4;
c1str ( );
switch(x)
{
case 0:
while (y>0)
do
{
case 1; x++;
case 2: ++x;
}
while (--y>0);
}
printf("5d", x);
}
Answer: Option C