Created
March 4, 2022 14:02
-
-
Save xvbnm48/21b12a65e44a09cb7c5dec9a9473fa16 to your computer and use it in GitHub Desktop.
switch golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main(){ | |
nilai := 3 | |
switch nilai { | |
case 1: | |
fmt.Println("nilai 1") | |
case 2: | |
fmt.Println("nilai 2") | |
case 3: | |
fmt.Println("nilai 3") | |
default: | |
fmt.Println("nilai tidak diketahui") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment