Roshan Book

My Tech Notebook

Learning Ruby Part 9 Expressions


E.g

a=3

b=6

a+b

It gives 9

Assigning value of variable to variable

d=33

f=d

Now if we change value of d to 3, f still has value 33.

Shorthands

g=68

g=g+20

 

Same thing could be written as

g+=12

Same thing could be done with –, *, /

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: