Arithmetic/Integer: Difference between revisions

(→‎{{header|Julia}}: updated to julia v0.6)
Line 1,005:
 
=={{header|Elena}}==
ELENA 3.12 :
<lang elena>import system'math.
import extensions.
Line 1,011:
program =
[
var a := console readLineTo:(Integer new).
var b := console readLineTo:(Integer new).
console writeLine:printLine(a:," + ": ,b:," = ":(,a + b).
console writeLine:printLine(a:," - ": ,b:," = ":(,a - b).
console writeLine:printLine(a:," * ": ,b:," = ":(,a * b).
console writeLine:printLine(a:," / ": ,b:," = ":(,a / b). // truncates towards 0
console writeLine:printLine(a:," % ":,b:," = ":(,a mod:b). // matches sign of first operand
].</lang>
 
Anonymous user