Go Array Calculate Standard Deviation
package main/*from w w w .j a v a2 s .c o m*/ import ( "fmt" "math" ) func main(){ var num[10] float64 var sum,mean,sd float64 for i := 1; i <= 10; i++ { num[i-1] = float64(i) + 123 sum += num[i-1] } mean = sum/10; for j := 0; j < 10; j++ { sd += math.Pow(num[j] - mean, 2) } sd = math.Sqrt(sd/10) fmt.Println("The Standard Deviation is : ",sd) }