Contents

Which loop is guaranteed to execute at least one time.
a) for                                     
b) while
c) do while                           
d) None of these

c

Explanation: In do while first the statements in the body are executed then the condition is checked. If the condition is true then once again statements in the body of do while are executed.


A labeled statement consist of an identifier followed by
a) ;                         
b) :                         
c) ,                          
d)  =

b

Explanation: The label is an identifier. When goto statement is encountered, control of the program jumps to label: and starts executing the code.


For loop in a C program, if the condition is missing?
a) it is assumed to be present and taken to be false
b) it is assumed to be present and taken to the true
c) it result in a syntax error
d)  execution will be terminated abruptly

b

Which of the following statement about for loop is true?
a) Index value is retained outside the loop
b) Index value can be changed from within the loop
c) Goto can be used to jump, out of the loop
d) All of these

d

Using goto inside for loop is equivalent to using
a) Continue                          
b) Break
c) Return                                              
d) None of these

d

Explanation: Goto statement is rarely used in loops,we can-not use continue,break & return instead of goto.


If switch feature is used, then
a) Default case must be present
b) Default case, if used, should be the last case
c) Default case, if used, can be placed anywhere                       
d) None of these

c