Ruby Exercises: Compute the sum of the two integers
Write a Ruby program to print "Ruby Exercises" 9 times.
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:
Ruby Code Editor:
Contribute your code and comments through Disqus.
Previous: 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.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics