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

14 lines
456 B
Text
Raw Permalink Normal View History

2025-08-11 18:05:26 -07:00
local function divmod(a, b) return { a // b, a % b } end
io.write("Input the first integer : ")
2026-04-30 12:34:36 -04:00
local a = tonumber(io.read())
2025-08-11 18:05:26 -07:00
io.write("Input the second integer: ")
2026-04-30 12:34:36 -04:00
local b = tonumber(io.read())
print($"sum: {a + b}")
print($"difference {a - b}")
print($"product {a * b}")
print($"quotient {a // b}")
print($"remainder {a % b}")
print($"exponentiation {a ** b}")
print($"divmod {divmod(a, b):concat(", ")}")