Files
the-way-to-go_ZH_CN/eBook/examples/chapter_5/switch2.go
2013-06-22 21:29:42 +08:00

17 lines
276 B
Go

package main
import "fmt"
func main() {
var num1 int = 7
switch {
case num1 < 0:
fmt.Println("Number is negative")
case num1 > 0 && num1 < 10:
fmt.Println("Number is between 0 and 10")
default:
fmt.Println("Number is 10 or greater")
}
}