Jump to content

Loops/While: Difference between revisions

added perl and python
m (Added to iteration category)
(added perl and python)
Line 52:
make "n 1024
while [:n > 0] [print :n make "n :n / 2]
 
=={{header|Perl}}==
<perl>$n = 1024;
while ($n > 0) {
print "$n\n";
$n >>= 1; # also acceptable: use integer; $n /= 2;
}</perl>
 
=={{header|Python}}==
<python>n = 1024
while n > 0:
print n
n = n / 2</python>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.