September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/Arithmetic-Integer/ALGOL-W/arithmetic-integer.alg
Normal file
14
Task/Arithmetic-Integer/ALGOL-W/arithmetic-integer.alg
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
begin
|
||||
integer a, b;
|
||||
write( "Enter 2 integers> " );
|
||||
read( a, b );
|
||||
write( "a + b: ", a + b ); % addition %
|
||||
write( "a - b: ", a - b ); % subtraction %
|
||||
write( "a * b: ", a * b ); % multiplication %
|
||||
write( "a / b: ", a div b ); % integer division %
|
||||
write( "a mod b: ", a rem b ); % modulo %
|
||||
% the ** operator returns a real result even with integer operands %
|
||||
% ( the right-hand operand must always be an integer, the left-hand %
|
||||
% operand can be integer, real or complex ) %
|
||||
write( "a ^ b: ", round( a ** b ) )
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue