...

/

Write Your First Ruby Program

Write Your First Ruby Program

Learn to write a basic "Hello World" program in Ruby.

"Hello World!" in Ruby

Let's first look at the output of the following program by clicking the "Run" button of the widget given below:

Press + to interact
puts "Hello World!"
# This is a comment that fits on one line
=begin
This second comment
fits
on multiple lines
=end

Explanation

Line 1: We used puts to print the output Hello World! in the ...