Posts

Showing posts from November, 2018

Ruby - Variables and Constants

Image
This article will focus on variables and constants in Ruby. Variables Variables are used as a location to store a value. Variables are assigned using equal (=) sign. Eg: x=5 Constants Variables which starts with a capital letter is a constant where it's value cannot be changed. Eg: MyNum = 20 Below output will be given when assigning a value to a constant variable. Try out the code to get a more clear idea.

Ruby - Dynamic, Open source programming language

Image
Hey all... CodeCircle is back with a new programming language. This article is intended to give you a basic introduction to Ruby programming language. Ruby is a Dynamic, Open source programming language which is mainly focused on simplicity and productivity. This language is completely a free language which is developed by  Yukihiro Matsumoto.  This article will help you to get a fresh start in Ruby. "Hello World...!" As the first command in Ruby, we will look how to print a statement in Ruby. Basically, the print statement can be printed using two methods, 1) puts method The built-in method puts used to print a statement. The strings are printed using single or double quotes. Given below is the command used to print the statement "Hello World...!". puts "Hello World...!" Try this command 2) print method Another built-in method is Print which can be shown as below. print "Hello World...!" Try this command In Rub