RosettaCodeData/Task/Arithmetic-Integer/Pluto/arithmetic-integer.pluto

14 lines
450 B
Plaintext

local function divmod(a, b) return { a // b, a % b } end
io.write("Input the first integer : ")
local a = io.read("n")
io.write("Input the second integer: ")
local b = io.read("n")
print($"sum: {a + b}")
print($"difference {a - b}")
print($"product {a * b}")
print($"quotient {a // b}")
print($"remainder {a % b}")
print($"exponentation {math.tointeger(a ^ b)}")
print($"divmod {divmod(a, b):concat(", ")}")