Jump to content

Arithmetic/Integer: Difference between revisions

m
Removed semicolons which aren't standard Scala syntax.
(Nimrod -> Nim)
m (Removed semicolons which aren't standard Scala syntax.)
Line 2,611:
val b = Console.readInt
val sum = a + b; //integer addition is discouraged in print statements due to confusion with String concatenation
println("a + b = " + sum);
println("a - b = " + (a - b));
println("a * b = " + (a * b));
println("quotient of a / b = " + (a / b)); // truncates towards 0
println("remainder of a / b = " + (a % b)); // same sign as first operand</lang>
 
=={{header|Scheme}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.