mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-12-23 21:52:39 +00:00
32 lines
590 B
Go
32 lines
590 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
var num1 int64
|
|
var num2 int64
|
|
var action string
|
|
|
|
func main() {
|
|
fmt.Println("Enter firs number:")
|
|
fmt.Scan(&num1)
|
|
fmt.Println("Enter second number:")
|
|
fmt.Scan(&num2)
|
|
fmt.Println("Enter operation('+', '-', '*' or '/'):")
|
|
fmt.Scan(&action)
|
|
|
|
if action == "+" {
|
|
fmt.Printf("%v + %v = %v\n", num1, num2, num1+num2)
|
|
}
|
|
if action == "-" {
|
|
fmt.Printf(" %v - %v = %v\n", num1, num2, num1-num2)
|
|
}
|
|
if action == "*" {
|
|
fmt.Printf(" %v * %v = %v\n", num1, num2, num1*num2)
|
|
}
|
|
if action == "/" {
|
|
fmt.Printf(" %v / %v = %v\n", num1, num2, num1/num2)
|
|
}
|
|
}
|