Java MCQs - Iterative Statements
Iteration is the process where statements are executed repeatedly for specified number and condition. Such statements are known as iterative statements
11. What is the correct output of this program ?
A. 1 2 3 4 5 6 7 8 9 10
B. 0 1 2 3 4 5 6 7 8 9 10
C. 1 2 3 4 5 6 7 8 9 10 11
D. None of above
View Answer
12. What is the functionality of break statement?
A. To terminate current iteration
B. To continue current iteration
C. To terminate main flow
D. To continue main flow
View Answer
13. What is the functionality of continue statement?
A. To terminate current iteration
B. To continue current iteration
C. To terminate main flow
D. To continue main flow
View Answer
14. What is difference between do while loop and while loop in Java?
A. for loop runs once even conditional clause is false
B. while loop runs once even conditional clause is false
C. do while loop runs once even conditional clause is false
D. All of above
View Answer
15. What is the correct output of this program ?
A. Run time Error
B. Compile time error
C. Infinite Loop
D. None of above
View Answer
16. What is the correct output of this program ?
A. Run time Error
B. 1 2 3 4 5 6 7 8 9 10
C. Infinite Loop
D. 0 1 2 3 4 5 6 7 8 9 10
View Answer
17. What is the correct output of this program ?
A. 1 2 3 4 5 6 7 8 9 10
B. None
C. 1 3 5 7 9
D. Infinite Loop
View Answer
18. What is the correct output of this program ?
A. None
B. 13
C. 1 3 5 7 9
D. Infinite Loop
View Answer
19. What is the correct output of this program ?
A. 2 4 6 8 10
B. Compile time error
C. Infinite Loop
D. None
View Answer
