Go code
for i := 1; i <= 3; i++ {
fmt.Println(i)
}Line-by-line explanation
i := 1creates the counter once.i <= 3is checked before each iteration.i++adds one after each iteration.- Println displays the current count.
Expected output
1
2
3This is the expected result.