Loops/Infinite: Difference between revisions
Content added Content deleted
No edit summary |
(Better D entry) |
||
Line 168: | Line 168: | ||
=={{header|D}}== |
=={{header|D}}== |
||
Some common ways to create an infinite printing loop: |
|||
⚫ | |||
<lang d>import std.stdio; |
|||
void main() { |
|||
⚫ | |||
while (true) |
|||
⚫ | |||
⚫ | |||
<lang d>import std.stdio; |
|||
⚫ | |||
void main() { |
|||
⚫ | |||
do |
|||
⚫ | |||
⚫ | |||
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}}== |
=={{header|dc}}== |