How would you implement integer division if your language did not offer it.
Anonymous
#Assumes positive numbers def divide(num, divide_by) answer = 0 return answer if divide_by == 0 while(num >= divide_by) num = num - divide_by answer = answer + 1 end answer end puts divide(10,0)
Check out your Company Bowl for anonymous work chats.