Home » C Programming » Loops » Question
  1. Which of the following statement is correct about the program given below?


    #include <studio.h>
    int main ()
    {
    int i = 0;
    for(i = 0; i <= 127; printf ("%d", i++))
    ;
    printf ("\n");
    return 0;
    }
    1. The program would go in an infinite loop.
    2. The program would output 0 1 2 ..... 126 127.
    3. The program would not produce any output.
    4. The program would report an error: Cannot use printf() in for loop.
Correct Option: B

The program would output 0 1 2 ..... 126 127.



Your comments will be displayed only after manual approval.