Ask Question
5 July, 04:38

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

+1
Answers (1)
  1. 5 July, 07:39
    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?
Get an answer to your question ✅ “What are Loop Errors? Describe briefly. What aresymptoms of Loop Errors? ...” 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