Task

Show the following output using one loop.

1, 2, 3, 4, 5
6, 7, 8, 9, 10



Try to achieve the result by forcing the next iteration within the loop
upon a specific condition, if your language allows it.



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(continue).
-export([main/0, for_loop/1]).
 
main() ->
	for_loop(1).
 
for_loop(N)  when N /= 5 , N <10 ->
	io:format("~p, ",[N] ),
	for_loop(N+1);
 
for_loop(N) when N >=10->
	if N=:=10 ->
		io:format("~p\n",[N] )
	end;
 
for_loop(N) ->
	if N=:=5 ->
		io:format("~p\n",[N] ),
		for_loop(N+1)
	end.
 