Hi,
Try like this
> -module(factorial).
> -export([main/0]).
>
> main() ->
> io:format("The factorial of 5 is: ~w~n", [fac(5)]). %%% change here
>
> fac(X) ->
> if X == 1 ->
> 1;
> true -> %%% change here
> X * fac(X - 1)
> end.
Good luck!
/Vlad