**Kotlin Program to Calculate Average Using Arrays**. In the below program, the numeracy stores the floating-point values whose average is to be found. Then, to calculate the average, we need to first calculate the sum of all elements in the array.

**Kotlin Program to Calculate Average Using Arrays**

**Source Code **

```
fun main(args: Array<String>) {
val numArray = doubleArrayOf(45.3, 67.5, -45.6, 20.34, 33.0, 45.6)
var sum = 0.0
for (num in numArray) {
sum += num
}
val average = sum / numArray.size
println("The average is: %.2f".format(average))
}
```

**Output**