Ask Question
27 January, 01:16

The break statement is used with which statement?

A) at

B) for

C) nested if

D) switch

+1
Answers (1)
  1. 27 January, 02:40
    0
    B) for

    Explanation:

    The break statement is used in looping constructs to break out of the loop.

    for is an example of a construct used for looping n Java.

    Consider the example:

    for (int i=0; i<10; o++) {

    System. out. print (i);

    if (i==5) break;

    }

    In this case the output will consist of 012345.

    When loop variable i is equal to 5, the if condition will be satisfied and the loop breaks due to break statement.

    Note that break is also used with switch ... case blocks, but in this case it is more closely tied to the case statement.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The break statement is used with which statement? A) at B) for C) nested if D) switch ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers