Ruby programming language.

Introduction to Ruby language.





Ruby is an object-oriented programming language developed by Yukihiro Matsumoto.
It is inspired by other low level programming languages like lisp, small talk and pearl and uses syntax that is easy for C and java programmers to learn.
It is a dynamic and open source programming language with a focus on simplicity and productivity ,has
an elegant syntax that is natural to read and easy to write

Features of Ruby  

  • object oriented
  • dynamic
  • meta programming
  • flexibility
  • variables and scope

Advanced Features

  • Exceptions for handling errors
  • garbage collector
  • os - independent threading , which allows you to write multi - threaded applications even on operating system such as dos
  • you can write extensions to ruby in c


Why Ruby?

  • Ruby is a server -side scripting language. It can be embedded into HTML .
  • Its is also used to build web applications and it has uses English words.
  • Like python it is also used for data analysis , prototyping and it is a flexible language.

Lets get started 


Inputs

Inputs are of two types:
  1. Compile time (Defined)
  1. Run time(Uses defined)
Simple code to print hello world.
puts "Hello world"


Printing Hello World


puts "Hello world"
Here we can see printing anything in ruby is very easy by giving  puts  before the statement.


Getting input from the user.

Getting input is  nothing but getting the input from the user. 
To get input from the user in ruby language we want to write as gets.chomp and to print into output screen we need to give puts "#{}


a=gets.chomp
program:
a=gets.chomp
puts "#{a}"




Comments

Post a Comment

Popular posts from this blog

R Language.

How to install R language and R studio in windows 10.

How does an IPL Player earn?