Task

Write a    for    loop which writes a countdown from   10   to   0.



Related tasks

   Loop over multiple arrays simultaneously
   Loops/Break
   Loops/Continue
   Loops/Do-while
   Loops/Downward for
   Loops/For
   Loops/For with a specified step
   Loops/Foreach
   Loops/Increment loop index within loop body
   Loops/Infinite
   Loops/N plus one half
   Loops/Nested
   Loops/While
   Loops/with multiple ranges
   Loops/Wrong ranges


%% Implemented by Arjun Sunel
-module(downward_loop).
-export([main/0]).
 
main() ->
	for_loop(10).    
 
 for_loop(N) ->
 	if N > 0 ->
		io:format("~p~n",[N] ),
		for_loop(N-1);
	true ->
		io:format("~p~n",[N])
	end.	
 