Ask Question
11 August, 16:59

What are Loop Errors? Describe briefly. What aresymptoms of Loop Errors?

+5
Answers (1)
  1. 11 August, 17:15
    0
    The errors in the loop condition such that it is not giving desired results or it is not running accordingly. There are different types of loop errors which are as following:-

    1. Infinite loop:-When the is not able to stop then the error is called infinite loop. for ex:-

    int i=1;

    while (i!=0)

    {

    cout<<"I am King"<
    i++;

    }

    2. Off by one error:-This error mostly happens in loop for arrays as indexing of the array is from 0 to size-1. So looping over the array up to the size is a off by one error.

    3. Equality v/s assignment operator error:-In this error the condition in the loop is like this d=f which is wrong since = is assignment operator it assigns the value of f to d while d==f checks that the value of d and f are equal or not.

    4.&& v/s || loop error: - In this error we use and operator (&&) instead of or operator (||) and vice versa.

    symptoms of loop errors are not the desired output.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What are Loop Errors? Describe briefly. What aresymptoms of Loop Errors? ...” 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