Skip to content
Quiz · Loops · lesson 2 of 8

Quiz — a sum in a loop

What does the program print?

GO
package main

import "fmt"

func main() {
    s := 0
    for i := 1; i < 5; i++ {
        s += i
    }
    fmt.Println(s)
}

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way