The idea of programming might sound like a frightening task, but don’t worry. We designed this blog so that you can get your feet wet without stepping into the deeper complexities of the programming.
This site is dedicated to all those people who want to learn the most basic but important Programming Language'C Programming'.
If done step wise C language is easy and fun to learn.
So lets get started.
Start reading from the First Post to understand C programming.You may read a desired topic from the labels.
One of the best methods to learn any programming language is to observe as much as programs you can , try editing them.
You can take a look at the various programs on this blog and feel free to ask if any doubts in with them.
Press Ctrl+D to add this page to your Favourites/Bookmarks for further reference.
Note:Your comments,queries and suggestions are welcome.Feel free to post them in the the comment boxes available after every post.

If you are interested in learning PHP, to create your own website or to spice up your existing website;here is the Best Tutorial available for PHP

Search C Programs,Compilers,Seminars ,Projects,etc.

Thursday, May 22, 2008

Hierarchy of Operations

The preference in which arithematic operations are performed in an arithematic expression is called as Hierarchy of operations.
Its very important in C Programming to predefine the Hierarchy of operations to the C compiler in order to solve the given arithematic expression correctly.
e.g.: If a programmer wishes to perform ,z=a+b/c;it may be interpretted as z=(a+b)/c or z=a+(b/c).
and if a=3,b=6,c=2 then using the same expression we will obtain two different answwers as z=4.5 or z=6.
To avoid this condition we must be aware of hierarchy of operations used in C programming.
In arithematic expressions scanning is always done from left to right.
The priority of operations is as shown below,
Priority Operators
First Paranthesis os brackets()
Second Multiplication & Divison
Third Addition & Substraction
Fourth Assignment i.e.=


If we consider the logical operators used in C language,the operator precedence will be like;


Operators Type
! Logical NOT
* / % Arithmetic and moulus
+ - Aritmetic
Relational
== !=Relational
&&Logical AND
||Logical OR
=Assignment


In the tables above,the higher the position of an operator,higher is its priority.

1 comment:

shaheen Rose said...

7erfirst of all i want to present my heartfelt Hello to this person who posted this important information. if every person act like you it would be better for then coming generation so once again i'm very every happy from this person which sacrificed his life for the people.
thanks a lot.