Home / C Programming / Control Structures :: Discussion

Discussion :: Control Structures

  1. What will be the output of the following piece of code?

    for(i = 0; i<10; i++);

    printf("%d", i);

  2. A.

     10

    B.

     0123456789

    C.

     Syntax error

    D.

     0

    E.

     Infinite loop

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Due to semicolon(;) at the end of the for loop, after 10 iterations for loop will be terminated and the result will be 10.


Be The First To Comment