Menu
×
×
Correct!

Exercise:

Complete the switch statement, and add the correct keyword at the end to specify some code to run if there is no case match in the switch statement.

int day = 4; switch (day) { case 1: printf("Saturday"); break; case 2: printf("Sunday"); break; default: printf("Weekend"); }

Not Correct

Click here to try again.

Correct!

Next ❯
int day = 4;
switch () {
   1:
    printf("Saturday");
    ;
   2:
    printf("Sunday");
    ;
  :
    printf("Weekend");
}

    
  




Go to w3schools.com
Reset Score
Close This Menu

Completed 0 of 39 Exercises:

C Syntax
C Comments
C Variables
C Data Types
C Operators
C If...Else
C Switch
C Loops
C Arrays
C Strings
C Pointers
C Functions
C Structures

×

Reset the Score?

This will reset the score of ALL 39 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 39 C exercises.

Share your score: