Loop Questions and Answers
Practice ModeShowing 10 of 98 questions
Q21
When loop looses its stop value then it is called
I. Odd loop
II. Even loop
III. Unknown loop
IV. User friendly loop
Answer: Option C
Q22
Which of the following loop is controlled by user ?
Answer: Option B
Q23
Find the output
void main ( )
{
int i;
for (i=1; i<=5; i++)
{
printf("%d", i);
if (i==3)
continue;
i++;
}
}
Answer: Option C
Q24
Find the output.
void main ( )
{
char a[ ]={'\0', 'n', 'i', 'c', 'e'};
int i;
for (i=0; i<sizeof(a); i++)
printf ("%d", a[i]);
}
Answer: Option A
Q25
Find the output
void main ( )
[
char a[ ]={'\0', 'n', 'i', 'c', 'e'};
int ;
for (i=0; i<sizeof (a); i++0
printf ("%c", a[i]);
}
Answer: Option A
Q26
Find the output
void main ( )
{
int i=0;
for ((; ++i<=5;)
printf ('%d", i);
}
Answer: Option B
Q27
Find the output
void main ( )
{
int x=1;
float y=3;
do
printf("%d', x++);
while (x!=y);
}
Answer: Option A
Q28
Find the output.
void main ( )
{
int x=5, y=6;
do
{
x=x+y;
y=x-y;
x=x+y;
}
while (x<y);
printf('%d %d", x, y);
}
Answer: Option A
Q29
Find the output
void main ( )
{
int x=15;
while (x!0)
{
printf('%x", x);
x=x/2;
}
}
Answer: Option C
Q30
State the incorrect statement.
Answer: Option C