Answer the question
In order to leave comments, you need to log in
Why is the function argument not being passed?
Hello. I learn the basics.
Here is the code
package main
import "fmt"
func xses(x) float64 {
var total float64 = 0
for i:=0; i < len(x); i++ {
total += x[i]
}
return total / float64(len(x))
}
func main() {
x := [5]float64{
98,
93,
77,
82,
83,
}
fmt.Println(xses(x))
}
# command-line-arguments
./main.go:7: undefined: x
./main.go:9: undefined: x
./main.go:10: undefined: x
./main.go:12: undefined: x
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question