Difference between revisions of "Loop"

From wikieduonline
Jump to navigation Jump to search
Line 22: Line 22:
 
done
 
done
 
</pre>
 
</pre>
 +
 +
 +
== See also ==
 +
* {{programming}}
 +
 +
[[Category:Programming]

Revision as of 06:40, 29 April 2020


Infinite loop

go

sum := 0
for {
    sum++ // repeated forever
    fmt.Println(sum)
}


Bash

#!/bin/bash
while true; do
 ((var++))
echo $var
done


See also

[[Category:Programming]

Advertising: