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.

For more details about increment/decrement operator Click Here.

Arithmetic Operators:

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

For more details about arithmetic operators Click Here.

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.

For more details about logical operators Click Here.

Relational Operators

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

For more details about relational operators Click Here.

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.

For more details about bit-wise operators Click Here.

Assignment Operators:

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

For more details about assignment operators Click Here.

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.

For more details about conditional or ternary operator Click Here.

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.

For more details misc about ternary operator Click Here.

Hope, it would be useful !!

To contribute :

If you like Advance Computing and would like to contribute, you can  mail your article to “computingadvance@gmail.com”. You will get credit as your name , email id, designation with article on this blog.

Leave a Reply