Junior — Senior
Sequential output of numbers with a one-second pause
livecode
Task condition
It is necessary to modify the program so that numbers from 1 to 10 are output one after another, with a one-second interval, using the printNumber function.
import (
"fmt"
"time"
)
func main () {
for counter:= 1; counter < 11; counter++ {
printNumber(counter)
}
}
func printNumber(value int) {
time.Sleep(time.Second)
fmt.Println(value)
}