• An operator is a special symbol that tells the compiler to perform some task.
  • C- Language provides large number of In-build operators.
  • An operator operates on operands.
  • Operators can be dividing into the following categories:
  1. Arithmetic operators:

  • Arithmetic operators are used to perform Arithmetic calculation such as addition, subtraction multiplication and division
  • Arithmetic operator are +,-,*,/.
  1. Assignment operator:

  • An assignment operator is used to assign value of right hand side expression to the left hand side expression. Example : a=10, b, b=a;
  1. Relational operators:

  • Relational operators are used to perform some Relational task.
  • They can be used for comparison purpose
  • It helps to determine whether the given value is greater than, less than or equal to other value.
  • Main operators are >,<,==,>=,<=.
  1. Logical operators:

  • Logical operators are used to perform logical task.
  • They can be used to combine multiple condition
  • They helps to determine what conditions are true or false bused on the given criteria.
  1. Conditional operator:

  • Conditional operator is used to perform assignment based on given expression.
  • It works similar to if….else statement.
  • If given expression evaluates to true then the value of first expression is assigned otherwise value of second expression will be assigned to the left hand side identifier.
  1. Increment/Decrement operators:

  • Increment & Decrement operators Increment and Decrement operand’s value by 1.
  • They are unary operator and works on single operand.
  • They have two forms:

(1) Prefix notation:

  • In prefix notation operator comes first before the operand. For example: ++i, -i

(2) Postfix notation:

  • In postfix notation operator comes after the operand. For example i++,–i
  • When prefix notation is used for assignment then the value will be either incremented or decremented first and then modified value will be assign to the left hand side operand.Example :inta,b=10; a=++b;
  • When postfix notation is used then it will assign original value first and then after the value will be incremented and decremented.Example :inta,b=10; a=b++;
  1. Bitwise operators:

  • Bitwise operators are used to perform operations on bit level.
  • Main operators are &,:,^,>>,<<.
  • We can also perform left shift and right shift operation at bit level.
  1. Special operators:

  • C-language provides the following special purpose operators:

(1) sizeof operator(2)  member access operator(3)*,&

  • size of operator returns the size of data variable passed within the argument.
  • Member access operator (‘.’) and (‘->’) are used to access data member of a structure and union.
  • *and & are used to define pointer variable and to assign address of variable
  1. Modulo operator:

  • A modulo operator (‘%’)is used to perform modulo operation.
  • It returns reminder value of division operation. For example: n=n%2;

Leave a Reply

Your email address will not be published. Required fields are marked *