update,
This commit is contained in:
9
task1/SCC_212_Advanced_Programming_Weeks_7/recursion.erl
Normal file
9
task1/SCC_212_Advanced_Programming_Weeks_7/recursion.erl
Normal file
@@ -0,0 +1,9 @@
|
||||
-module(recursion).
|
||||
-export([fac/1,start/0]).
|
||||
|
||||
fac(N) when N == 0 -> 1;
|
||||
fac(N) when N > 0 -> N*fac(N-1).
|
||||
|
||||
start() ->
|
||||
X = fac(4),
|
||||
io:fwrite("~w",[X]).
|
Reference in New Issue
Block a user