puts "Hello World";
Printing 'Hello World' is as simple as the above line.
Also the print statement can be written using the below statement :
print "Hello World";
puts "Hello World."; puts "A Beautiful City."
print "Hello World."; print "A Beautiful City."
The codes in Ruby should be written inside a file with extension '.rb'.
So, we will be writing the above code to print Hello World inside a file named FirstApplication.rb.
puts "Hello World";
Now, to execute the above code, we have to type the following in the command prompt :
Ruby FirstApplication.rb