Control Instructions on C related Questions and Answers

Question 1 : Which for loop has range of similar indexes of 'i' used in for (i = 0;i < n; i++)?
1. for (i = n; i>0; i–)
2. for (i = n; i >= 0; i–)
3. for (i = n-1; i>0; i–)
4. for (i = n-1; i>-1; i–)
View Answer   Discuss with Members

Question 2 : The C code 'for(;;)' represents an infinite loop. It can be terminated by ___________
1. break
2. exit(0)
3. abort()
4. terminate
View Answer   Discuss with Members

Question 3 : Which of the following is an invalid if-else statement?
1. if (if (a == 1)){}
2. if (func1 (a)){}c) if (a){}d) if ((char) a){}
3.
4.
View Answer   Discuss with Members

Question 4 : goto can be used to jump from main() to within a function.
1. true
2. false
3. depends
4. varies
View Answer   Discuss with Members

Question 5 : Which keyword is used to come out of a loop only for that iteration?
1. break
2. continue
3. return
4. none of the mentioned
View Answer   Discuss with Members

Question 6 : Which keyword can be used for coming out of recursion?
1. break
2. return
3. exit
4. both break and return
View Answer   Discuss with Members

Question 7 : Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3)?
1. Variable
2. Function
3. typedef
4. macros
View Answer   Discuss with Members

Question 8 : What is an example of iteration in C?
1. for
2. while
3. do-while
4. all of the mentioned
View Answer   Discuss with Members

Question 9 : Which loop is most suitable to first perform the operation and then test the condition?
1. for loop
2. while loop
3. do-while loop
4. none of the mentioned
View Answer   Discuss with Members

Question 10 : Which datatype can accept switch statement?
1. int
2. char
3. long
4. all of the mentioned
View Answer   Discuss with Members


View 1 - 10 of 14 Questions

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter