algo_080
Problem Statement
Problem Statement
Write an algorithm to find the factorial of a number using recursion.
Algorithm
procedure Factorial(N)
begin
if N < 0 then
print("Invalid input")
return(-1)
endif
if N = 0 or N = 1 then
return(1)
else
return(N * Factorial(N - 1))
endif
end procedure1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13