Loops/While: Difference between revisions

175 bytes removed ,  3 months ago
m
added output
imported>J7M
(Add SmallBASIC example)
m (added output)
(3 intermediate revisions by 3 users not shown)
Line 1,572:
 
=={{header|Elena}}==
ELENA 46.x:
<syntaxhighlight lang="elena">public program()
{
Line 1,578:
while (i > 0)
{
console.writeLine:(i);
i /= 2
Line 2,170:
 
=={{header|langur}}==
0.8 changed the keyword for a test only loop from for to while.
 
{{works with|langur|0.8}}
<syntaxhighlight lang="langur">var .i = 1024
while .i > 0 {
writeln .i
.i \= 2
}</syntaxhighlight>
 
{{works with|langur|< 0.8}}
<syntaxhighlight lang="langur">var .i = 1024
for .i > 0 {
writeln .i
.i \= 2
Line 3,286 ⟶ 3,276:
end while;
end func;</syntaxhighlight>
{{out}}
<pre>
1024
512
256
128
64
32
16
8
4
2
1
</pre>
 
=={{header|SenseTalk}}==
Line 3,770 ⟶ 3,774:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">var i = 1024
while (i > 0) {
System.print(i)
62

edits