gokursu/functions/demo3.go

10 lines
156 B
Go
Raw Normal View History

2024-01-14 14:29:53 +00:00
package functions
func AddVariadic(numbers ...int) int{
total := 0
for i := 0; i < len(numbers); i++ {
total = total + numbers[i]
}
return total
}