Use while as a Loop Modifier : while as Modifier « Statement « Ruby






Use while as a Loop Modifier




value = 0
    
value += 1 while value < 100
    
puts value

 








Related examples in the same category

1.like if, you can use while as a statement modifier, at the end of a statement