Loops/Infinite: Difference between revisions
Content added Content deleted
No edit summary |
(Better D entry) |
||
Line 168:
=={{header|D}}==
Some common ways to create an infinite printing loop:
<lang d>while(1) writeln("SPAM") ;▼
<lang d>import std.stdio;
void main() {
do writeln("SPAM"); while(1);▼
while (true)
}</lang>▼
<lang d>import std.stdio;
for(;;) writeln("SPAM") ;▼
void main() {
l: writeln("SPAM"); goto l;▼
do
▲</lang>
while (true);
}</lang>
<lang d>import std.stdio;
void main() {
for (;;)
}</lang>
<lang d>import std.stdio;
void main() {
LOOP:
goto LOOP;
}</lang>
=={{header|dc}}==
|