Mushi

funcoes.go

Apr 24th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.27 KB | None | 0 0
  1. // funcoes funcoes.go
  2. package main
  3.  
  4. import "fmt"
  5.  
  6. func somar(a int, b int) int {
  7.     return a + b
  8. }
  9.  
  10. func imprimir(valor int) {
  11.     fmt.Println(valor)
  12. }
  13.  
  14. // main.go
  15. // To run this code "go run *.go"
  16. func main() {
  17.     resultado := somar(3, 4)
  18.     imprimir(resultado)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment