Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. Determine Output:

    void main()

    {

    int i=3;

    switch(i)

    {

    default: printf("zero");

    case 1: printf("one"); break;

    case 2: printf("two"); break;

    case 3: printf("three"); break;

    }

    }

  2. A.

     zero

    B.

     three

    C.

     Error

    D.

     None of These

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    The default case can be placed anywhere inside the loop. It is executed only when all other cases doesn't match.


Be The First To Comment