- package main
-
- import "fmt"
-
- var num1, num2 int = 10, 20
- var sum_, diff, mlti int
-
- func main() {
- sum_, diff, mlti = calculate1(num1, num2)
- PrintValues()
- sum_, diff, mlti = calculate2(num1, num2)
- PrintValues()
- }
-
- func PrintValues() {
- fmt.Printf("sum = %d, differce = %d, mlti = %d\n", sum_, diff, mlti)
- }
-
- func calculate1(input1, input2 int) (int, int, int) {
- return input1 + input2, input1 - input2, input1 * input2
- }
-
- func calculate2(input1, input2 int) (x2 int, x3 int, x4 int) {
- x2 = input1 + input2
- x3 = input1 - input2
- x4 = input1 * input2
- return
- }