1. In the following loop construct, which one is executed only once always.
for(exp1; exp2; exp3)
Explanation: Expression exp1 is executed only once since this is used for initialization
2. The continue statment cannot be used with
Explanation: continue is used to skip the statments and can not be used with switch
3. Which keyword can be used for coming out of recursion?
Expanation: Return is used for coming out of recursion
4. goto can be used to jump from main to within a function?
Explanation: goto statement in C programming provides an unconditional jump from the 'goto' to a labeled statement in the same function.
5. Which of the following is an invalid if-else statement?
6. Switch statement accepts.
Explanation: switch statment accepts all int , char and long .
7. Which loop is guaranteed to execute at least one time.
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.
8. A labeled statement consist of an identifier followed by
Explanation: The label is an identifier. When goto statement is encountered, control of the program jumps to label: and starts executing the code.
9. do-while loop terminates when conditional expression returns?
Explanation: zero indicate False which terminate the loop .
10. c = (n) ? a : b; can be rewritten asexp1 ? exp2 : exp3;
Also check :