Go language program to print numbers from 1 to 10 using for loop

Views: 11   

Following program shows you how to print numbers from 1 to 10 using for loop.

package main

import "fmt"

func main() {
for input := 1; input <= 10; input++ {
    fmt.Println(input)
  }
}

Output:

1
2
3
4
5
6
7
8
9
10
On By