Posts tagged ‘do’
do while in ruby
How to achieve the do ..while loop in Ruby?
Yes this can be, just bit tricky.
Just consider one of the syntax of while loop in ruby
<expression> while <expression>
This repeats evaluation of left hand side expression, while right hand side is true.
x = 5 begin print x print " " x += 1 end while(x<10) o/p 5 6 7 8 9


