Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_numbers
- (1..100).each do |num|
- output = ''
- output += 'APing' if num % 3 == 0
- output += 'BPong' if num % 5 == 0
- if output.empty?
- puts num
- else
- puts output
- end
- end
- end
- print_numbers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement