Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Integer-comparison/Go/integer-comparison.go
Normal file
26
Task/Integer-comparison/Go/integer-comparison.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var n1, n2 int
|
||||
fmt.Print("enter number: ")
|
||||
if _, err := fmt.Scan(&n1); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Print("enter number: ")
|
||||
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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue