Advertisement
cwchen

[Go] multiple else if demo

Sep 14th, 2017
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.28 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     score := 88
  9.  
  10.     if score >= 90 {
  11.         fmt.Println("A")
  12.     } else if score >= 80 {
  13.         fmt.Println("B")
  14.     } else if score >= 70 {
  15.         fmt.Println("C")
  16.     } else if score >= 60 {
  17.         fmt.Println("D")
  18.     } else {
  19.         fmt.Println("F")
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement