RosettaCodeData/Task/Arithmetic-Integer/Lua/arithmetic-integer.lua

10 lines
290 B
Lua
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
local x = io.read()
local y = io.read()
print ("Sum: " , (x + y))
print ("Difference: ", (x - y))
print ("Product: " , (x * y))
print ("Quotient: " , (x / y)) -- Does not truncate
print ("Remainder: " , (x % y)) -- Result has sign of right operand
print ("Exponent: " , (x ^ y))