fork download
  1. function fact (n)
  2. if n == 0 then
  3. return 1
  4. else
  5. return n * fact(n-1)
  6. end
  7. end
  8.  
  9. print("enter a number:")
  10. a = io.read("*number")
  11. print(fact(a))
Compilation error #stdin compilation error #stdout 0.02s 2128KB
stdin
Standard input is empty
compilation info
prog.nim(1, 8) Error: undeclared identifier: 'function'
stdout
Standard output is empty