Loops/While: Difference between revisions

(Added Ada)
Line 28:
}</pre>
 
=={{header|Haskell}}==
 
Introducing and especially updating a loop variable requires side effects. So it's simpler to just create a list of the required values, and then loop over it to print them. However, that doesn't really reflect the structure of the imperative solutions.
 
<pre>
mapM print $ takeWhile (>0) $ iterate (`div` 2) 1024
</pre>
 
=={{header|Java}}==