Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. Fact(1) if n=1
  2. Fact(n) =
  3. Fact(n-1)*n if n>1
  4.  
  5. fact(5)=fact(4)*5
  6. but : fact(4)=fact(3)*4
  7. but : fact(3)=fact(2)*3
  8. but : fact(2)=fact(1)*2
  9. but : fact(1)=1
  10. then : fact(2)=1*2=2
  11. then : fact(3)=2*3=6
  12. then : fact(4)=6*4=24
  13. then : fact(5)=24*5=12
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement