Loops/Do-while: Difference between revisions
Content added Content deleted
(→{{header|PL/0}}: Added a solution.) |
|||
Line 2,543: | Line 2,543: | ||
} while (value % 6); |
} while (value % 6); |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
=={{header|PL/0}}== |
|||
PL/0 does not have a <code>do .. while</code> construct. Equivalent using <code>while</code>: |
|||
<syntaxhighlight lang="pascal"> |
|||
var i; |
|||
begin |
|||
i := 0; |
|||
i := i + 1; |
|||
! i; |
|||
while (i / 6) * 6 <> i do |
|||
begin |
|||
i := i + 1; |
|||
! i |
|||
end; |
|||
end. |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
1 |
|||
2 |
|||
3 |
|||
4 |
|||
5 |
|||
6 |
|||
</pre> |
|||
=={{header|PL/I}}== |
=={{header|PL/I}}== |