GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Monday, December 20, 2010

While Loop In Ruby

while looping

>> comment = ''
>> while comment!='bye'
>> puts comment
>> comment = gets.chomp
>> end


Code to iterate:
>> i = 0;
>> while i<=10
>> puts i
>> i = i+1   # cannot use i++
>> end
Share/Bookmark

No comments:

Post a Comment