Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

Go Golang for loop

// Program to print the first 5 natural numbers

package main
import "fmt"

func main() {

    // for loop terminates when i becomes 6
    for i := 1; i <= 5; i++ {
      fmt.Println(i)
    }

}
 
PREVIOUS NEXT
Tagged: #Go #Golang #loop
ADD COMMENT
Topic
Name
1+5 =