Advertisement
Hiteshw11

Use of While Loop in Ruby

Sep 26th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.21 KB | None | 0 0
  1. puts "Enter the number from which you have to start printing"
  2. i=gets.chomp().to_i
  3. puts "Enter the number where you have to stop"
  4. b=gets.chomp().to_i
  5. puts "The numbers are"
  6. while i<=b
  7.   puts i
  8.   i=i+1
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement