Professional Documents
Culture Documents
Hilot Ruby
Hilot Ruby
Hilot Ruby
I
T S
1
1. Finding a Compiler:
Before starting 2. Programming in
programming in Ruby, a Ruby:
compiler is needed to
compile and run our
To program in Ruby is
programs. There are many easy to learn because of
online compilers that can its similar syntax to
be used to start Ruby already widely used
without installing a languages.
compiler.
Writing Programs in Ruby
Syntax:
Writing Programs in Ruby
Example:
A simple program to print “Hello Geeks!!
Welcome to GeeksforGeeks”
Output:
3. Comments
•# is called the pound character in ruby and it is used to add
comments to your code.
•=begin, =end are used for multi-line comments
6. Getting input
•‘gets.chomp’ is used to take input from user.
•‘print’ can be used instead for ‘puts’to print without a new
line.
Example:
These are the most basic topics of Ruby that are essential
for the beginner of Ruby programming language. We will
cover more topics of Ruby in our upcoming articles.
THANK YOU!