Program to perform divison operation of two numbers without using /, %, and modules operator


def devide(divisor, dividend)
  quotient = 0
  until(dividend < divisor) do
    dividend -= divisor
    quotient += 1
  end
  quotient
end

puts devide(15, 100)

Comments

Popular posts from this blog

Rails Kaminari - Ajax pagination

Rails 4, MySQL, and Emoji (Mysql2::Error: Incorrect string value: '\xF0\x9F\x8C\x9D')