Here we are sharing a ruby program to print Hello World with the output. The Hello World! program is a good way to get started with Ruby programming language.
Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
Create a text file called hello_world.rb and copy paste below code. Execute this file by typing ruby hello_world.rb into your terminal and pressing enter.
1 2 3 4 5 6 7 | =begin Ruby program to print Hello World. =end puts "Hello World!" print "Hello World!" puts "Hello World!" |
Program Output
Below are the output of above program.
Hello World!
Hello World!Hello World!
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.