Question

    Which of the following is not true for for-loop?

    A for (i=0; i Correct Answer Incorrect Answer
    B for (int i=0; i>9; i++) Correct Answer Incorrect Answer
    C for (i=10; i Correct Answer Incorrect Answer
    D for (i=10; i++; i Correct Answer Incorrect Answer

    Solution

    Among the given statements about for loops, the one that is NOT true is that they are used to replace user input while loops. While for loops are typically used for iterations with a known count and are less likely to result in an infinite loop if used correctly, they do not specifically replace user input while loops.

    Practice Next