Let’s create our very first Ruby program, the classic “Hello World” program.
For this, we use the built-in puts method.
puts “Hello World”
This code will output the text “Hello World” to the screen.
Another method that can be used to display output to the screen is print.
print “Hello World”
This code displays the same output as before, except that the puts automatically adds a new line after the output, while print does not.
CLICK ON THE BUTTON BELOW TO GO TO THE RUBY MAIN COURSE PAGE.
© License: All Rights Reserved
CONTACT HOLLA TECH – LEARN SUPPORT