Difference between revisions of "For (go lang)"

From wikieduonline
Jump to navigation Jump to search
 
Line 4: Line 4:
 
  [[package]] main
 
  [[package]] main
 
   
 
   
  [[import]] "fmt"
+
  [[import]] "[[fmt]]"
 
   
 
   
 
  [[func]] [[main]]() {  
 
  [[func]] [[main]]() {  

Latest revision as of 19:56, 10 December 2021


package main

import "fmt"

func main() { 
  sum := 0

 for {
    sum++
    fmt.Println(sum)
 }
}

See also[edit]

Advertising: