Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. Determine Output:

    void main()

    {

    int i=0;

    for(;i++;printf("%d", i));

    printf("%d", i);

    }

  2. A.

     1

    B.

     11

    C.

     12

    D.

     Error

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Before entering into the for loop checking condition is "evaluated". Here it evaluates to 0 (false) and comes out of the loop, and i is incremented (note the semicolon after the for loop).


Be The First To Comment