w3resource

Ruby Exercises: Print "Ruby Exercises" 9 times


Write a Ruby program to print "Ruby Exercises" 9 times.

Ruby Exercises: Print

Ruby Code:

9.times{
      puts("Ruby exercises")
 }

Output:

Ruby exercises
Ruby exercises
Ruby exercises
Ruby exercises
Ruby exercises
Ruby exercises
Ruby exercises
Ruby exercises
Ruby exercises

Flowchart:

Flowchart: Print 'Ruby Exercises' 9 times

Go to:


PREV : Write a Ruby program to compute the sum of the two integers, if the two values are equal return double their sum otherwise return their sum.
NEXT : Write a Ruby program to create a new string from a given string with the last character added at the front and back of the given string. The lenght of the given string must be 1 or more.

Ruby Code Editor:



Contribute your code and comments through Disqus.

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.