Computer Science & EngineeringProblem Solving Lab →List Of Experiments

Numerical Representation

1. The execution of a loop typically starts with:
a) initialization statements
b) Loop body
c) test condition
d) update statements

2) The break statement is used to exit from:
a) an if statement
b) a for loop
c) a program
d) the main( ) function

3) A do-while loop is useful when we want that the statements within the loop must be executed
a) only once
b) At Least Once
c) More than once
d) None of the above

4) In what sequence the initialization, testing and execution of body is done in a do-while loop
a) Initialization, execution of body, testing
b) Execution of body, initialization, testing
c) Initialization, testing, execution of body
d) None of the above

5) Which looping process checks the test condition at the end of the loop?
a) for
b) while
c) do-while
d) No looping peocess check condition at the end

6) A continue statement causes execution to skip to:
a) the end of the program
b) the first statement after the loop
c) the statement following the continue statement
d) the next iteration of the loop

7) The statement i++; is equivalent to:
a) i = i + i;
b) i = i + 1;
c) i = i - 1;
d) i - - ;

8) Another word for "looping" is:
a) recapitulation
b) tintinabulation
c) iteration
d) reiteration

9) Which looping process is best used when the number of iterations is known?
a) for
b) while
c) do-while
d) all of the above

10) Which of the following is not an infinite loop.
a) int i = 1 ; while ( 1 ) { i++ ; }
b) for( int i =1; i < 10 ; i--) printf("Hello World");
c) for(int i =1; i<100; i++) printf("Hello World");
d) int i = 0; do{ i-- printf("%d ",i); }while(i>0);