Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 576 Bytes

comments.md

File metadata and controls

27 lines (20 loc) · 576 Bytes

Comments

What is a comment?

  • Are line of annotations within Ruby code that are ignored at runtime.
  • We use comment to make source code easier to understand.

Single line comments

A single line comment start with # character

# This is a single line comment
puts 'Welcome to comment section'

When executed, output of above program will Welcome to comment section

Multiline comments

Multiline comments using by =begin and =end syntax

=begin 
This is a multiline comment
Write your comment here
=end
puts 'Welcome to comment section'