...
This commit is contained in:
parent
051504d65b
commit
0457928c3e
295 changed files with 3588 additions and 3 deletions
10
Task/Arithmetic-Integer/Ruby/arithmetic-integer.rb
Normal file
10
Task/Arithmetic-Integer/Ruby/arithmetic-integer.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
"Remainder: #{x%y}", # same sign as second operand
|
||||
"Exponentiation: #{x**y}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue