I'm new to Erlang and I've tried some Erlang constructions. My program should behave something like that:
if x == 42:
print "Hi"
else:
print "Hello"
Here is my code in Erlang
-module(tested).
-export([main/0]).
main() ->
{ok, X} = io:fread("","~d"),
case X == 42 of
true -> io:fwrite("Hi\n");
false -> io:fwrite("Hello\n")
end.
Thanks in advance for help.