Break and Continue in C MCQs Exercise I

Ques 1 Break and Continue


We cannot use 'continue' in switch case.

A True
B False
C N/A
D N/A

Ques 2 Break and Continue


Which of the following that can use in both switch and loop?

A break
B continue
C both (a) and (b)
D None of these

Ques 3 Break and Continue


What is the output of the following code?


#include<sdtio.h>
int main()
{
     int num=0;
     num++;
     ++num;
     switch(num)
     {
           case 1:
                     printf("SmallCode 1");
           case 2:
                    printf("SmallCode 2");
           case 3:
                    printf("SmallCode 3"); break;
           default:
                    printf("Default SmallCode");
     }
}

A SmallCode 2 SmallCode 3
B SmallCode 1
C SmallCode 2
D SmallCode 1 SmallCode 2 SmallCode 3 Default SmallCode