Classical

C Programming MCQ - Decision Making & Looping

26:  

In a for loop, if the condition is missing, then infinite looping can be avoided by a

A.

break statement

B.

goto statement

C.

return Statement

D.

All of the above

 
 

Option: D

Explanation :


27:  

Which of the following comments about for loop are correct?

A.

Index value is retained outside the loop and can be changed from within the loop

B.

Body of the loop can be empty

C.

go to can be used to jump. out of loop

D.

All of the above

 
 

Option: D

Explanation :


28:  

Which of the following comments about for loop are correct ?

A.

Using break is equivalent to using a goto that jumps to the statement immediately following the loop

B.

Continue is used to by-pass the remainder of the current pass of the loop

C.

If comma operator is used, then the value returned is the value of the right operand

D.

All of the above

 
 

Option: D

Explanation :


29:  

Choose the correct answers

A.

for loops can be nested

B.

Nested for loop can't overlap

C.

Both (a) & (b) 

D.

None of the above

 
 

Option: C

Explanation :


30:  

Consider the following program fragment

if (a > b)
if (b > c)
s1 ;
else s2;


s2 will be executed if

A.

a <= b

B.

b > c

C.

b <= c and a <=b

D.

a> b and b <= c

 
 

Option: D

Explanation :




Suggest an improvement