Ask Question
3 October, 17:52

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

+2
Answers (1)
  1. 3 October, 21:16
    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 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