Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
while loop
do-while loop
for loop
if statement
continue
break
return
goto
Which control flow statement is used to exit from a loop?
exit
A switch statement can only test for equality, while if-else statements can test for any condition.
A switch statement can test for any condition, while if-else statements can only test for equality.
A switch statement is more efficient than a series of if-else statements for testing a single variable against multiple values.
There is no difference between a switch statement and a series of if-else statements.
To define a new variable in the code.
To provide a descriptive name for a loop or if statement.
To mark a specific point in the code that can be jumped to using the goto statement.
To create a custom exception class.
It terminates the current loop or switch statement.
It skips the remaining statements in the current iteration of the loop.
It jumps to a specific label in the code.
It creates a new loop or switch statement.
skip
What is the output of the following program?
public class Main {public static void main(String[] args) {int i = 0;do { System.out.print(i + " "); i++;} while(i < 5);}}
0 1 2 3 4
1 2 3 4 5
0 1 2 3 4 5
None of the above
==
!=
<=
><