Sha256: 8f683ca61b4f26d739d2e7a0311164c5f370d461b39de4f0c19cccd96eb2613b

Contents?: true

Size: 463 Bytes

Versions: 10

Compression:

Stored size: 463 Bytes

Contents

% Implemented by Arjun Sunel
-module(arith).
-export([start/0]).
 
start() ->
   case io:fread("","~d~d") of
       {ok, [A,B]} ->
           io:format("Sum = ~w~n",[A+B]),
           io:format("Difference = ~w~n",[A-B]),
           io:format("Product = ~w~n",[A*B]),
           io:format("Quotient = ~w~n",[A div B]),      % truncates towards zero
           io:format("Remainder= ~w~n",[A rem B]),    % same sign as the first operand
           halt()
   end.

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/erlang.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/erlang.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/erlang.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/erlang.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/erlang.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/erlang.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/erlang.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/erlang.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/erlang.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/erlang.txt