Comments are non-executable statements in Ruby. Comments are hidden from Ruby Interpreter so that these lines are ignored. They are used for increasing readability of the program. We can write comments anywhere in a program except inside a variable, because Ruby Interpreter considers it as a String.

Single line Comment:

Single line comment is created using #(Hash) sign in Ruby.

print “Hello World”	 #Used to Display the Text

Whenever, Ruby finds # on a line, everything after that will be ignored.

Multiple line Comment:

Multiple line comments are created using the code blocks =begin / =end

This is used
to illustrate
multiple line comments
in Ruby language.
The statements inside this block are ignored by the Ruby Interpreter.

Valid example of Commenting:

Puts “4 * 6 = #{4*6}”	#Multiplies 4 with 6 and Displays result