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

10 lines
290 B
Lua
Raw Permalink Normal View History

2013-04-10 15:42:53 -07: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))