In this post we will talk about Operators in C Programming but before that we will understand Expressions and Operands because both these terms will be used very often in this post.

In C programming there is a combination of expression variables, constants and operators which is written by following the syntax of C language.

By evaluating all C language expressions, its result value is assigned to a variable. I have given examples of expression below.

```
x = a * b - c
y = b + c * a
z = a - b * c + d;
```

Operators and Operands both seem like words, so some programmers think that these two are the same term but in real it is not so.

To process any operation in our program, the values, variables or constants that are used with the operator are called operands. Let us understand from the expression given below.

`c = a+b;`

In the above expression **c, a and b** are operands, apart from these there are** = **and operators.

Any programming language is incomplete without operators because there is hardly any computer program in which operators are not used.

Operators in C programming are special symbols whose meaning and use are already fixed. We use operators to perform specific mathematical or logical operations (tasks) in our C programs.

In C Programming Language also you get many types of operators from which you can do different things.

Operators in C Programming

You have understood what operators are and now you will understand the operators types one by one in details.

You are already familiar with Arithmetic Operators because since childhood we have been doing addition (+), subtraction (-), multiplication (*), division (/) and modulus (%).

You will get the basic information of arithmetic operators only after seeing the table given below, but I would suggest that for detailed information, you must read the tutorial thoroughly by clicking on the link given below.

Operator | Name | Description |
---|---|---|

+ | Addition | To add operands |

â€“ | Subtraction | To subtract the operands |

* | Multiplication | To multiply in operands |

/ | Divide | To participate in operands |

% | Modulus | To find the remainder by dividing the operands |

As we read above that arithmetic operators are used for mathematical operations.

With the help of arithmetic operators, assignment operators are used to evaluate (solve) the mathematical expression and assign its result to a variable.

Assignment operator ( = ) assigns (copy) the result value of the right side value, variable, constant or expression to the left side variable.

You will get the basic information of the assignment operators only after seeing the table and example given below, but I would suggest that for detailed information, you must read the tutorial thoroughly by clicking on the link given below.

Operator | Name | Description |
---|---|---|

= | Simple Assignment | To assign value to left side variable by solving right side values â€‹â€‹or expression |

+= | Addition Assignment | To assign to the left side variable by adding Left and Right side values â€‹â€‹(variable) |

-= | Subtraction Assignment | To assign the left and right side values â€‹â€‹(variables) to the left side variables. |

*= | Multiplication Assignment | To assign to the left side variable by multiplying the left and right side values â€‹â€‹(variable) |

/= | Division Assignment | To assign the left and right side values â€‹â€‹(variable) to the left side variable by dividing |

%= | Modulo Assignment | To assign the remainder to the left side variable by dividing the left and right side values â€‹â€‹(variable) |

Relational operators are used to compare the relationship of 2 values. These operators return 0 if the relationship is false and return a non-zero integer number if it is true.

You will get the basic information of relational operators only after seeing the table and example given below, but I would suggest that for detailed information, you must read the post thoroughly by clicking on the link given below.

Operator | Name | Description |
---|---|---|

== | Equal to | When the values â€‹â€‹of both the operands are equal then True will return. |

!= | Not Equal to | When the values â€‹â€‹of both the operands are different then True will return. |

< | Less than | When the value of the left operand is less than the value of the right operand, then True will return. |

> | Greater than | When the value of the left operand is greater than the value of the right operand, then True will return. |

<= | Less than or equal to | True will return when the value of the left operand is less than or equal to the value of the right operand. |

>= | Greater than or equal to | True will return when the value of the left operand is greater than or equal to the value of the right operand. |

As you read above, relational operators are used to define conditions.

Sometimes we have to define more than one condition in our programs which are related to each other and for this we use logical operators.

Logical Operators after examining the result values â€‹â€‹(true, false) of all the conditions, returns false i.e. 0 and true i.e. non-zero integer number.

You will get the basic information of logical operators only after seeing the table and example given below, but I would suggest that for detailed information, you must read the tutorial thoroughly by clicking on the link given below.

Operator | Name | Description |
---|---|---|

&& | AND | When all the conditions are true then True will return. |

|| | OR | When out of all the conditions if any one condition is true then True will return. |

! | NOT | It reverses the result of the condition i.e. true to false and false to true. |

We use conditional operator in decision making just like if-else statement. You can also say that this is a short form of if-else.

Conditional operator (ternary operator) uses two symbols ( ) and ( : ).

The condition comes before the question mark symbol ( ? ) and is followed by the true expression (statement) and the false expression comes after the colon mark ( : ).

`(condition) ? true-expression : false-expression;`

For detailed information of conditional operator with C Programs examples, you must read the tutorial thoroughly by clicking on the link given below.

Increment** ( ++ ) **and Decrement **( â€” ) **operators are unary operators i.e. they are used only with a single variable.

With the help of the increment operator, the value of the variable gets incremented by 1 number and with the help of the decrement operator, the value of the variable gets decremented by 1 number.

You can also write x = x + 1 as ++x

You can also write x = x â€“ 1 as â€“ â€“ x

For detailed information of increment and decrement operators with C Programs examples, you must read the tutorial thoroughly by clicking on the link given below.

I hope that you have liked this post. If you liked the post, then please share it with your friends and relatives and you can send your suggestion in the comment box below or email me at pr***********@gm***.com.