RosettaCodeData/Task/Arithmetic-Integer/Brat/arithmetic-integer.brat

8 lines
213 B
Plaintext

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}"