Ask Question
17 February, 21:32

If you want to stop a loop before it goes through all its iterations, the break statement may be used.

True False

+5
Answers (1)
  1. 17 February, 23:21
    0
    True: If you want to stop a loop before it goes through all its iterations, the break statement can be used.

    Explanation:

    break and continue statements are used to stop loop from it's normal execution.

    If we use break statement, the program control moves to the next line outside loop.

    i=0;

    sum=0;

    while (i<=50)

    {

    if (sum > 100)

    break;

    sum=sum+i;

    i++;

    }

    But if we use continue statement, the program control moves to the beginning of the loop.

    i=0;

    sum=0;

    while (i<=50)

    {

    if (i%2==0)

    i++;

    continue;

    sum=sum+i;

    i++;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “If you want to stop a loop before it goes through all its iterations, the break statement may be used. True False ...” 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