Jump to content

Loops/For with a specified step: Difference between revisions

(Added МК-61.)
Line 258:
8
10</pre>
 
=={{header|Ela}}==
<lang erlang>%% Implemented by Arjun Sunel
-module(loop_step).
-export([main/0, for_loop/1]).
% This Erlang code for "For Loop" is equivalent to: " for (i=start; i<end ; i=i+2){ printf("* ");} " in C language.
main() ->
for_loop(1).
for_loop(N) when N < 4 ->
io:fwrite("* "),
for_loop(N+2);
for_loop(N) when N >= 4->
io:format("").
</lang>
 
{{out}}
<pre>
* * * * ok
</pre>
 
=={{header|Euphoria}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.