Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. Determine Output:

    void main()

    {

    int i = -1;

    +i;

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

    }

  2. A.

     i = -1, +i = 1

    B.

     i = 1, +i = 1

    C.

     i = -1, +i = -1

    D.

     None of These

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Unary + is the only dummy operator in C. Where-ever it comes you can just ignore it just because it has no effect in the expressions (hence the name dummy operator).


Be The First To Comment