Home » C Programming » Loops » Question
  1. In the program given below, point out the error, if any, in the for loop.

    #include <studio.h>
    int main()
    {
    int i = 1;
    for (;;)
    {
    printf("%d\n", i++);
    if (i > 10)
    break;
    }
    return 0;
    }
    1. There should be a condition in the for loop.
    2. The two semicolons should be dropped.
    3. The for loop should be replaced by a while loop.
    4. No error
Correct Option: D

No error



Your comments will be displayed only after manual approval.