jocaml/test.ml

11 lines
164 B
OCaml
Raw Normal View History

2021-07-31 21:29:12 +00:00
Printf.printf "hello world!\n"
let rec fac (n : int) : int =
if n <= 1 then
1
else
fac (n-1) * n;;
Printf.printf "fac 6 is %d\n" (fac 6)