Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fact(1) if n=1
- Fact(n) =
- Fact(n-1)*n if n>1
- fact(5)=fact(4)*5
- but : fact(4)=fact(3)*4
- but : fact(3)=fact(2)*3
- but : fact(2)=fact(1)*2
- but : fact(1)=1
- then : fact(2)=1*2=2
- then : fact(3)=2*3=6
- then : fact(4)=6*4=24
- then : fact(5)=24*5=12
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement