Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "Enter a number:"
- n = gets.chomp.to_i
- while n <= 100 do
- if n.odd?
- n * 3
- else
- n / 2
- end
- puts n
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement