Sha256: a5d0f0bb8c531a1297b551111497a98ba815cbf2cd41d3f57aacf462dec0ba9a

Contents?: true

Size: 254 Bytes

Versions: 10

Compression:

Stored size: 254 Bytes

Contents

Inspired by the second VBScript version.
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}"

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/brat.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/brat.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/brat.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/brat.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/brat.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/brat.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/brat.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/brat.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/brat.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/brat.txt