Difference between revisions of "For (go lang)"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
  
  
<pre>
 
package main
 
  
import "fmt"
+
[[package]] main
 
+
func main() {  
+
[[import]] "fmt"
  sum := 0
+
 
+
[[func]] main() {  
for {
+
  sum := 0
    sum++
+
    fmt.Println(sum)
+
  for {
 +
    sum++
 +
    fmt.Println(sum)
 +
  }
 
  }
 
  }
}
 
</pre>
 
  
 
== See also ==
 
== See also ==

Revision as of 08:12, 29 August 2021


package main

import "fmt"

func main() { 
  sum := 0

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

See also

Advertising: