Sunday, July 7, 2013

Operators in C

Operators are nothing but symbols which are used to perform some operation on the operands i.e., variables or constants.

If you consider the below example,
2+3
Here,

  • 2 and 3 are operands
  • + is an operator. 
There are four types of operators in C. They are
  • Assignment Operator
  • Mathematical Operators
  • Relational Operators
  • Logical Operators
All these operators play an important role in building the C program. 

Assignment operator is used to assign some value to the variable or an operand. Mathematical Operators are used for performing some kind of Arithmetic or Mathematical calculations. Relational operators are used to find the relation between two operands and Logical operators are used to perform logical operations on the operands. 

We will discuss about each topic briefly in the coming sections.