The return value always going to be
(). But this is different from what gets printed. Sometimes in the toplevel (REPL), they get mixed together. But also you didn’t pass
x to the function.
val x : int = 5
# Printf.printf " the value of x=%d";;
- : int -> unit = <fun>
# Printf.printf " the value of x=%d" x;;
the value of x=5- : unit = ()