I would like this code to take two numbers and display the divisible numbers for the first, the second, and the two. But I was not able to make use of the current AND for this case, because the array div_pelos2 returns empty.
def self.divisiveis(num1, num2)
div_num1 = Array.new
div_num2 = Array.new
div_pelos2 = Array.new
for i in 1..49
i += 1
if i % num1 == 0
div_num1.push (i)
elsif i % num2 == 0
div_num2.push (i)
elsif (i % num1 == 0) && (i % num2 == 0)
div_pelos2.push (i)
end
end
return div_pelos2, div_num1, div_num2
end
end