Tuesday, January 12, 2010

UNIT – 4
CONTROL STATEMENTS

1) The ____ statement is used to control the flow of execution of statements.
a) *if b)loops c)arrays d) None
2) In if statement, block of statements enclosed within a pair of ___ braces.
a) *{ } b)[ ] c) ( ) d) None
3) _____ statement is used for multi-way decision making .
a) while b)for c)*switch d) None
4) The _ statement at the end of block enables the control to exit from the switch statement.
a)exit() b)*break c)for d) None
5) The _____, is the optional case which is executed only when the result of the conditional expression does not match with any of the case values.
a) case b)switch c)*default d) None
6) C support the _ statement to branch unconditionally from one to another in the program.
a) *goto b)if c)switch d) None
7) The goto statement requires a _____ to identify the place where the control should be branched to .
a) if b)*label c)break d) None
8) ______ allow a statement or block of statements to be repeated.
a) if b)switch c)*loop d) None
9) In entry-controlled loop, the control conditions are tested _the loop execution begins.
a) *before b)after c) end d) None
10) If the condition does not result in termination of the loop then body of the loop keeps executing continuously . This type of loop is called ____.
a) *Infinite loop b)condition loop c)exit-controlled loop d)None
11) The ____ loop keeps repeating an action until an associated test returns false.
a)for b)*while c)do-while d) None

12) In ____ loop, the condition is first evaluated and if the condition evaluate to true, then the body of loop is executed.
a) for b)*while c)do-while d) None
13) In _____ type of loop, condition is at the end of the loop body.
a) for b)while c)*do-while d) None
14) In _____ type of loop, guarantees that the loop body is executed at least once even condition is true or false.
a) for b)while c)*do-while d) None
15) The _____ loop keeps repeating an action until an associated test returns false.
a) for b) *while c) do-while d) None
16) The _____ loop keeps repeating an action until an associated test returns true.
a) for b) while c) *do-while d) None
17) The do-while loop is called __________.
a) *exit-controlled loop b)entry-controlled loop c)both d) None
18) The for loop is called __________.
a) exit-controlled loop b)*entry-controlled loop c) both d)None
19) The ____ loop works well where the number of iterations of the loop is known before the loop is entered.
a) *for b)while c)do-while d) None
20) The _____ loop is extremely flexible and allows many types of program behavior to be specified simple and quickly .
a) *for b)while c)do-while d) None
21) The loop with in loop is called _______.
a) two loops b)many loops c)*nested loop d)None
22) Nested loop may continue upto ____ levels in ANSI – C.
a) 10 b) *15 c)22 d) None
23) The _____ statement is used to exit from a loop or switch , control passing to the first statement beyond the loop or switch.
a) *break b)exit() c)default d) None
24) _____ statement works only within loops where its effect is to force an immediate jump to the loop control statement.
a) break b)*continue c)default d) None
25) What is out put of the program.
For(int I=0;I<10;I++);
Printf(“\n%d”,I);
a) display 0 to 9 b)display 1 to 10 c) *display 10 only d) None





UNIT – 4
CONTROL STATEMENTS
1 A 2 A 3 C 4 B 5 C
6 A 7 B 8 C 9 A 10 A
11 B 12 B 13 C 14 C 15 B
16 C 17 A 18 b 19 A 20 A
21 C 22 B 23 A 24 B 25 C