Difference between revisions of "For (go lang)"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 6: Line 6:
 
  [[import]] "fmt"
 
  [[import]] "fmt"
 
   
 
   
  [[func]] main() {  
+
  [[func]] [[main]]() {  
 
   sum := 0
 
   sum := 0
 
   
 
   

Revision as of 19:06, 27 October 2021


package main

import "fmt"

func main() { 
  sum := 0

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

See also

Advertising: