RosettaCodeData/Task/Integer-comparison/Erlang/integer-comparison.erl

18 lines
520 B
Erlang
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
main() ->
{ok, [N]} = io:fread("First integer: ", "~d"),
{ok, [M]} = io:fread("First integer: ", "~d"),
if
N < M ->
io:format("~b is less than ~b~n",[N,M]);
N > M ->
io:format("~b is greater than ~b~n",[N,M]);
N == M ->
io:format("~b is equal to ~b~n",[N,M])
end.
2016-12-05 22:15:40 +01:00
if
N =< M ->
io:format("~b is less than or equal to ~b~n",[N,M]);
N >= M ->
io:format("~b is greater than or equal to ~b~n",[N,M])
end.