Zoho Control Flow Quiz 1

Question 1

Time: 00:00:00
Which keyword can be used for coming out of recursion?

break

break

return

return

exit

exit

Both a and b

Both a and b

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
What is the output of this C code?

int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
continue;
}
}

2

2

3

3

4

4

5

5

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
The keyword ‘break’ cannot be simply used within:

do-while

do-while

if-else

if-else

for

for

while

while

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
What is the output of this C code?
void main()

{
int i = 0, j = 0;
for (i = 0;i < 5; i++)
{
for (j = 0;j < 4; j++
{
if (i >1)
break;
}
printf("Hi \n");
}
}

Hi is printed 5 times

Hi is printed 5 times

Hi is printed 4 times

Hi is printed 4 times

Hi is printed 9 times

Hi is printed 9 times

Hi is printed 3 times

Hi is printed 3 times

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
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");

}

In for loop after loop

In for loop after loop

After loop

After loop

Compile time error

Compile time error

Undefined behaviour

Undefined behaviour

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
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;
}

After loop

After loop

Infinite loop

Infinite loop

In for that loop

In for that loop

Compile error

Compile error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
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);
}

1 4

1 4

1 2 4

1 2 4

1 3 4

1 3 4

Compilation erroe

Compilation erroe

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
What is the output of code given below?

int main()

{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%d\n", 3);
}

1 2 3

1 2 3

1 3

1 3

1 2

1 2

Compilation error

Compilation error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What is output of code given below?
int main(){
int i = 0, j = 0;
while (i < 2){
l1 : i++;
while (j < 3){
printf("Loop\n");
goto l1;

}
}

Loop Loop

Loop Loop

Infinite Loop

Infinite Loop

Compilation Error

Compilation Error

Loop Loop Loop

Loop Loop Loop

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
What is the output of this C code?

int main()

{

int i = 0, j = 0;

while (i < 5, j < 10)

{

i++;

j++;

}

printf("%d, %d\n", i, j);

}

5, 5

5, 5

5,10

5,10

10,10

10,10

Syntax error

Syntax error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%