Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. Comment on the output of this C code?


        int main()

        {

            int a = 1;

            switch (a)

            case 1:

               printf("%d", a);

            case 2:

                printf("%d", a);

            case 3:

               printf("%d", a);

           default:

                printf("%d", a);

        }

  2. A.
    No error, output is 1111
    B.
    No error, output is 1
    C.
    Compile time error, no break statements
    D.
    Compile time error, case label outside switch statement

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    none


Be The First To Comment