addition example
This commit is contained in:
parent
72293d4155
commit
26adaad561
2 changed files with 4 additions and 2 deletions
|
@ -2,8 +2,9 @@ package functions
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
func Addition() {
|
func Addition(number1 int, number2 int) {
|
||||||
|
var total = number1 + number2
|
||||||
|
fmt.Println("Result : ", total)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SayHello() {
|
func SayHello() {
|
||||||
|
|
1
main.go
1
main.go
|
@ -18,4 +18,5 @@ func main() {
|
||||||
arrays.Demo4()
|
arrays.Demo4()
|
||||||
slices.Demo2()
|
slices.Demo2()
|
||||||
functions.SayHello()
|
functions.SayHello()
|
||||||
|
functions.Addition(2,6)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue