Ruby Basic Exercises: Print a specified character twenty times
Ruby Basic: Exercise-32 with Solution
Write a Ruby program to print a specified character twenty times.
Ruby Code:
puts '*'*20
puts '#'*20
puts '@'*20
Output:
******************** #################### @@@@@@@@@@@@@@@@@@@@
Flowchart:
Ruby Code Editor:
Contribute your code and comments through Disqus.
Previous:Write a Ruby program to retrieve the total marks where subject name and marks of a student stored in a hash.
Next: Write a Ruby program to test whether a year is leap year or not.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework