How to use simple function with parameters and return value in Go

1 Answer

0 votes
package main

import "fmt"

func add(x int, y int) int {
	return x + y
}

func main() {
	fmt.Println(add(345, 99))
}



/*
run:

444

*/

 



answered Aug 24, 2020 by avibootz

Related questions

1 answer 172 views
2 answers 123 views
1 answer 174 views
174 views asked Aug 7, 2020 by avibootz
1 answer 215 views
3 answers 291 views
3 answers 364 views
...