Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. // this function should be able to factorise any number
  2.  
  3.  
  4. int num
  5.  
  6. func factorial(int n) return int {
  7. if num<1 {
  8. return 0
  9. }
  10. else {
  11. return num * factorial( n - 1 )
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement