# Operators in C

The C operators are kinds of symbol, which informs the compiler to perform a specific logical or mathematical operation.

There are various type of operator in C :

Unary Operators :

The unary operator works on a single operand or variable. Increment/Decrement operators also called as Unary operators.

Binary Operators:

The binary operator works on two operands or variables like arithmetic operator, relational operator, bit-wise operator assignment operator, and logical operator.

Ternary Operator:

The ternary operator works on more than two operands or variables like conditional operator. The conditional operator also called a ternary operator.

Increment/Decrement Operators:

The increment / Decrement operators are used to perform increment/decrement operation. In the case of increment operation the value of operand or variable incremented by one, while in the case of decrement operation the value of operand or variable decremented by one. e.g. x++, ++x, x–, –x.

Arithmetic Operators:

These operators are used to perform mathematical operations. e.g. Addition, Subtraction, Multiplication, Division, Modulus.

Logical Operators:

The logical operators are used to perform the logical operation on two operands or variables. e.g. AND operation, OR operation, NOT operation.

Relational Operators

The relational operators are used to perform the relational operation between two operands or variables. e.g. comparison, equality check, etc.

Bit-wise Operators

The bitwise operators are used to perform bit-wise operations on operands or variables. e.g. bit-wise AND operation, bit-wise OR operation, etc.

Assignment Operators:

The assignment operators are used to perform assignment operation i.e. assigning some values to variables.

Conditional or Ternary Operator:

The conditional or ternary operator is used to perform the conditional operation on three operands or variables. e.g. If the condition is true, it returns first value i.e. TRUE case value, otherwise returns second value i.e. FALSE case value.

Misc operators:

The & operator is used to get the address of the operand or variable. e.g. &x, it will give the address of x.

The * operator is used as a pointer to the variable. e.g. *x, * is a pointer to the variable x.

The sizeof() operator is used to get the size of the variable. e.g. sizeof(x), it will return the size of x.