Advertisement
Guest User

Untitled

a guest
Nov 12th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. print "Enter a number:"
  2. n = gets.chomp.to_i
  3. while n <= 100 do
  4. if n.odd?
  5. n * 3
  6. else
  7. n / 2
  8. end
  9. puts n
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement