7 lines
213 B
Text
7 lines
213 B
Text
x = ask("First number: ").to_i
|
|
y = ask("Second number: ").to_i
|
|
|
|
#Division uses floating point
|
|
#Remainder uses sign of right hand side
|
|
[:+ :- :* :/ :% :^].each { op |
|
|
p "#{x} #{op} #{y} = #{x.call_method op, y}"
|