Sha256: 8005717928c80379de84028abb08ffae0d4c6bcfdebcc4e77ea8e1e7118bdbd4
Contents?: true
Size: 362 Bytes
Versions: 10
Compression:
Stored size: 362 Bytes
Contents
puts 'Enter x and y' x = gets.to_i # to check errors, use x=Integer(gets) y = gets.to_i puts "Sum: #{x+y}", "Difference: #{x-y}", "Product: #{x*y}", "Quotient: #{x/y}", # truncates towards negative infinity "Quotient: #{x.fdiv(y)}", # float "Remainder: #{x%y}", # same sign as second operand "Exponentiation: #{x**y}"
Version data entries
10 entries across 7 versions & 1 rubygems