Solution Review: Filling Array with Loop Counter
This lesson discusses the solution to the challenge given in the previous lesson.
We'll cover the following...
Press + to interact
package mainimport "fmt"func main() {var arr [15]intfor i:=0; i < 15; i++ { // counter-controlled looparr[i] = i}fmt.Println(arr) // [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14]}
As you can see, in main
...