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


a is the correct option





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


a is the correct option





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


a is the correct option