Chapter - 4: The Loop Control Structure

Which of the following is not an infinite loop.


D
Sections
5
Exercises

A

B

C

D

E

1

2

3

4

5

6

7

8

9

1.

int i = 1;
while(1)
{
	i++;
}

2.

for(; ;);

3.

int t = 0,f;
while(t)
{
	f = 1;
}

4.

int y, x = 0;
do
{
	y = x;
}while(x == 0);

Ans: 4


© 2020 Garbage Valuegarbage value logo