C Operators

Operators

C divides the operators into the following groups:

  • Arithmetic Operators

  • Unary Operators

  • Relational and Logical Operators

  • Assignment Operators

  • Conditional Operator


Arithmetic Operators

Arithmetic operators are used to perform common mathematical operations.

Example :

Output:

UNARY OPERATORS

Arithmetic operators are used to perform common mathematical operations.

  • Increment. (++)

  • Decrement. (--)

Example :

Output:

RELATIONAL & LOGICAL OPERATORS

  • There are six relational operators in C. They are,

Note: Relational operators work as a true or false. if true then return 1 or return 0.

Example :

Output:

ASSIGNMENT OPERATORS

  • +=, -=,*=,/= those are assignment operators.

Example :

Output: