Difference between revisions of "For (go lang)"

From wikieduonline
Jump to navigation Jump to search
(Created page with " <pre> package main import "fmt" func main() { sum := 0 for { sum++ // repeated forever fmt.Println(sum) } } </pre> == See also == * {{go}}")
 
Line 7: Line 7:
  
 
func main() {  
 
func main() {  
sum := 0
+
  sum := 0
  
 
  for {
 
  for {
     sum++ // repeated forever
+
     sum++
 
     fmt.Println(sum)
 
     fmt.Println(sum)
 
  }
 
  }

Revision as of 08:09, 29 April 2020


package main

import "fmt"

func main() { 
  sum := 0

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

See also

Advertising: