Loops/While: Difference between revisions

→‎{{header|REXX}}: added version 3, added comments. -- ~~~~
m (→‎version 2: added version 3, also added comments in header section for version 2. -- ~~~~)
(→‎{{header|REXX}}: added version 3, added comments. -- ~~~~)
Line 855:
=={{header|REXX}}==
===version 1===
<lang rexx>/*REXX program to show a DO WHILE construct. */
Using integer division '''%''' here:
<lang rexx>/*REXX program to show a DO WHILE construct. */
j=1024
do while j>0
 
do while say j>0
j=j%2 /*in REXX, % is integer division. */
say j
end</lang>
j=j%2
end</lang>
'''output'''
<pre style="height:30ex;overflow:scroll">
Line 884 ⟶ 882:
x=1024
do while x>0
say right(x,10) /*pretty up the output by aligning.*/
x=x%2 /*in REXX, % is integer division. */
end</lang>
Line 905 ⟶ 903:
x=1024
do while x>>0 /*this is an exact comparison. */
say right(x,10) /*pretty up the output by aligning.*/
x=x%2 /*in REXX, % is integer division. */
end</lang>