Ask Question
22 March, 23:27

The break statement is used with which statement?

A) at

B) for

C) nested if

D) switch

+3
Answers (1)
  1. 23 March, 03:27
    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?
Find an answer to your question ✅ “The break statement is used with which statement? A) at B) for C) nested if D) switch ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers