another addition example
This commit is contained in:
parent
26adaad561
commit
71468385e2
2 changed files with 4 additions and 2 deletions
|
@ -2,9 +2,9 @@ package functions
|
|||
|
||||
import "fmt"
|
||||
|
||||
func Addition(number1 int, number2 int) {
|
||||
func Addition(number1 int, number2 int) int{
|
||||
var total = number1 + number2
|
||||
fmt.Println("Result : ", total)
|
||||
return total
|
||||
}
|
||||
|
||||
func SayHello() {
|
||||
|
|
2
main.go
2
main.go
|
@ -19,4 +19,6 @@ func main() {
|
|||
slices.Demo2()
|
||||
functions.SayHello()
|
||||
functions.Addition(2,6)
|
||||
var total = functions.Addition(3,8)
|
||||
fmt.Println(total)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue