Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. def find_factors(numbers)
  2. factors = []
  3. x = 0
  4. while x < numbers do
  5. if (x % numbers == 0)
  6. factors.push(x)
  7. end
  8. x += 1
  9. puts x
  10. end
  11. puts "THIS IS X: #{x}"
  12. puts "THIS IS FACTORS: #{factors}"
  13. end
  14. find_factors(20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement