Sha256: bd5f741bc8ae20af3b3dc8718107b94f101db1c1f9a0fcc5931dabcdef1b8773

Contents?: true

Size: 387 Bytes

Versions: 10

Compression:

Stored size: 387 Bytes

Contents

val a = Console.readInt
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

Version data entries

10 entries across 7 versions & 1 rubygems

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