Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Loops-For/Erlang/loops-for.erl
Normal file
24
Task/Loops-For/Erlang/loops-for.erl
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
%% Implemented by Arjun Sunel
|
||||
-module(nested_loops).
|
||||
-export([main/0, inner_loop/0]).
|
||||
|
||||
main() ->
|
||||
outer_loop(1).
|
||||
|
||||
inner_loop()->
|
||||
inner_loop(1).
|
||||
|
||||
inner_loop(N) when N rem 5 =:= 0 ->
|
||||
io:format("* ");
|
||||
|
||||
inner_loop(N) ->
|
||||
io:fwrite("* "),
|
||||
inner_loop(N+1).
|
||||
|
||||
outer_loop(N) when N rem 5 =:= 0 ->
|
||||
io:format("*");
|
||||
|
||||
outer_loop(N) ->
|
||||
outer_loop(N+1),
|
||||
io:format("~n"),
|
||||
inner_loop(N).
|
||||
Loading…
Add table
Add a link
Reference in a new issue