Ask Question
24 April, 08:48

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. 24 April, 09:06
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers