Ask Question
31 October, 04:21

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

True False

+4
Answers (1)
  1. 31 October, 06:14
    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?
Get 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 & 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