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.

package main import ("fmt") func main() { var day = 4 switch day { case(1): fmt.Print("Saturday") case(2): fmt.Print("Sunday") default: fmt.Print("Weekday") } }

Not Correct

Click here to try again.

Correct!

Next ❯
package main
import ("fmt")

func main() {
  var  = 4
  switch day {
  (1):
    fmt.Print("Saturday")
  (2):
    fmt.Print("Sunday")
  :
    fmt.Print("Weekday")   
  }
}

    
  




Go to w3schools.com
Reset Score
Close This Menu

Completed 0 of 28 Exercises:

GO Syntax
GO Comments
GO Variables
GO Data Types
GO Arrays
GO Operators
GO Conditions
GO Switch
GO Loops
GO Functions

×

Reset the Score?

This will reset the score of ALL 28 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 28 GO exercises.

Share your score: