Home / C Programming / Control Instructions :: Discussion

Discussion :: Control Instructions

  1. Point out the error, if any in the program.

     #include
     int main()
     {   
         int a = 10;   
         switch(a)     
         {
         }   
         printf("This is c program.");     
         return 0; 
     } 

     

  2. A.

    Error: No case statement specified

    B.

    Error: No default specified

    C.

    No Error

    D.

    Error: infinite loop occurs

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    There can exists a switch statement, which has no case.


Be The First To Comment