Loading...

C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Decision making & Loops-2 MCQs

C Decision making & Loops-2


1. Which keyword can be used for coming out of recursion?

a) return
b) break
c) exit
d) both A and B



2. goto can be used to jump from main to within a function?

a) True
b) False



3. Which of the following is an invalid if-else statement?

a) if (if (a == 1)){}
b) if (a){}
c) if ((char) a){}
d) if (func1 (a)){}



4. Switch statement accepts

a) int
b) char
c) long
d) All of the above



5. Which loop is guaranteed to execute at least one time?

a) for
b) while
c) do while
d) None of the above



6. A labeled statement consist of an identifier followed by

a) ;
b) :
c) ,
d) =



7. do-while loop terminates when conditional expression returns?

a) One
b) Zero
c) Non - zero
d) None of the above



8. 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



9. 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



10. Using goto inside for loop is equivalent to using

a) Continue
b) Break
c) Return
d) None of the above



- Related Topics