Loop Control


  1. Which of the following is not a valid flow control statement?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    exit() is not a flow control statement in Java. exit() terminates the currently running JVM.


  1. From where break statement causes an exit?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The break statement causes an exit from innermost loop or switch.



  1. What is true about do statement?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Do statement checks the condition at the end of the loop. Hence, code gets executed at least once.


  1. What is true about a break?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Break halts the execution and forces the control out of the loop.



  1. The while loop repeats a set of code while the condition is not met?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    While loop repeats a set of code only until the condition is met.