Home » C Programming » Decision Making » Question
  1. Which of the following is the correct output for the program given below?
    #include <studio.h>
    int main ( )
    {
    int i = 5;
    switch (i)
    {
    printf ("outside case\n");
    case 5:
    printf ("case 5\n");
    break;
    case 10:
    printf ("case 10\n");
    break;
    }
    return 0;
    }
    1. outside case
      case 5
    2. outside case
      case 10
    3. case 5
    4. case 10
    5. outside case
      case 5
      case 10
Correct Option: C

Only matching case will be executing.
So ans is case 5



Your comments will be displayed only after manual approval.