C Language - Control Statements

You Are Here :: Home > C Language > Control Statements - General Questions

 
7.

What's wrong? for (int k = 2, k <=12, k++)

A. the increment should always be ++k B. the variable must always be the letter i when using a for loop
C. there should be a semicolon at the end of the statement D. the commas should be semicolons




8.

What's wrong? while( (i < 10) && (i > 24))

A. the logical operator && cannot be used in a test condition B. the while loop is an exit-condition loop
C. the test condition is always false D. the test condition is always true




9.

If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block?

A. parentheses ( ) B. braces { }
C. brackets [ ] D. arrows < >




10.

What's wrong? (x = 4 && y = 5) ? (a = 5) ; (b = 6);

A. the question mark should be an equal sign B. the first semicolon should be a colon
C. there are too many variables in the statement D. the conditional operator is only used with apstrings




11.

The first expression in a for loop is

A. Step value of loop B. Value of the counter variable
C. Any of above D. None of above




12.

Which of the following statement is used to take the control to the beginning of the loop ?

A. break B. continue
C. exit D. None of these




« previous

1

2

3

4

5

6

7

next »

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on