BlueZero

Untitled

Jun 8th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1.  
  2. function fact (n)
  3. if n == 0 then
  4. return 1
  5. else
  6. return n * fact(n-1)
  7. end
  8. end
  9.  
  10. print("Enter a number:")
  11. a = io.read("*number")
  12. print(fact(a))
Advertisement
Add Comment
Please, Sign In to add comment