Solution Review: Filling Array with Loop Counter
This lesson discusses the solution to the challenge given in the previous lesson.
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]}
Get hands-on with 1400+ tech skills courses.