Files
the-way-to-go_ZH_CN/eBook/examples/chapter_5/switch2.go
2015-03-03 12:25:25 -05:00

17 lines
292 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")
}
}