switch2.go 292 B

12345678910111213141516
  1. package main
  2. import "fmt"
  3. func main() {
  4. var num1 int = 7
  5. switch {
  6. case num1 < 0:
  7. fmt.Println("Number is negative")
  8. case num1 > 0 && num1 < 10:
  9. fmt.Println("Number is between 0 and 10")
  10. default:
  11. fmt.Println("Number is 10 or greater")
  12. }
  13. }