Loop Questions and Answers
Practice ModeShowing 10 of 98 questions
Q41
Find the output
void main ( )
{
int i;
while (i=strrcmp ("cite", "cite\0"));
}
Answer: Option A
Q42
Find the output
void main ( )
{
int i;
for (i=3; i<15; i+=3);
printf("%d", i);
}
Answer: Option C
Q43
In a for loop if the condition is missing then.
Answer: Option A
Q44
Find the output.
void main ( )
{
int i, j;
for (i=3; i>=1;j--)
for (j=i;j>=1' j--)
printf ("%d", i);
}
Answer: Option B
Q45
Find the output
void main ( )
{
int i=5. c=0;
do
{
i--;
c++;
}
whie (i==0);
printf('%d', c);
}
Answer: Option C
Q46
Find the correct output.
void main ( )
{
while (99)
{
if (printf("%d", printf ('%d")))
break;
else
continue;
}
}
Answer: Option A
Q47
How many times the loop will be executed ?
void main ( )
{
int i=0;
for (;i++;)
printf ("%d", i);
}
Answer: Option C
Q48
How many times a for loop will exeuted in this program ?
void main ( )
{
char ch;
for (ch=0; ch<128; ch+4)
printf('%d", ch);
}
Answer: Option D
Q49
Find the output
void main ( )
int x=0;
for (;;)
{
if (++x==6)
break;
continue;
}
printf('X=%d", x);
}
Answer: Option B
Q50
Infinite loop can be used for
Answer: Option C