2013-04-10 21:29:02 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2015-02-20 00:35:01 -05:00
|
|
|
"fmt"
|
|
|
|
|
"log"
|
2013-04-10 21:29:02 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2015-02-20 00:35:01 -05:00
|
|
|
var n1, n2 int
|
2020-02-17 23:21:07 -08:00
|
|
|
fmt.Print("enter number: ")
|
2015-02-20 00:35:01 -05:00
|
|
|
if _, err := fmt.Scan(&n1); err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
2020-02-17 23:21:07 -08:00
|
|
|
fmt.Print("enter number: ")
|
2015-02-20 00:35:01 -05:00
|
|
|
if _, err := fmt.Scan(&n2); err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
switch {
|
|
|
|
|
case n1 < n2:
|
|
|
|
|
fmt.Println(n1, "less than", n2)
|
|
|
|
|
case n1 == n2:
|
|
|
|
|
fmt.Println(n1, "equal to", n2)
|
|
|
|
|
case n1 > n2:
|
|
|
|
|
fmt.Println(n1, "greater than", n2)
|
|
|
|
|
}
|
2013-04-10 21:29:02 -07:00
|
|
|
}
|