diff --git a/README.md b/README.md index c5d4f5b..338aa0c 100644 --- a/README.md +++ b/README.md @@ -290,6 +290,12 @@ Please note that this project is released with a [Code of Conduct](CODE_OF_CONDU - [![twitter-alt][twitter-img]](https://twitter.com/Dmytro_Litvinov) [![github-alt][github-img]](https://github.com/DmytroLitvinov) +### Dmytro Grendach +- DevOps engineer from Zhdany, Ukraine +- Interested in Python, Golang +- [![twitter-alt][twitter-img]](https://twitter.com/dmytrogrendach) + [![github-alt][github-img]](https://github.com/grendach) + ### duongoku - I'm a student and I'm in last year of highschool. - I'm interested in competitive programming, physics, calculus and tech stuff. diff --git a/code/golang/gocalc/gocalc.go b/code/golang/gocalc/gocalc.go new file mode 100644 index 0000000..e7fb335 --- /dev/null +++ b/code/golang/gocalc/gocalc.go @@ -0,0 +1,31 @@ +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) + } +} diff --git a/code/golang/read_input.go b/code/golang/read_input.go deleted file mode 100644 index f026659..0000000 --- a/code/golang/read_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "fmt" -) - -func main() { - fmt.Println("Hi! Please enter your name...") - var inpt string - fmt.Scan(&inpt) - fmt.Printf("Hello %s, welcome on Hacktoberfest!\n", inpt) -}