1. Operators in C
Arithmetic Operators
Increment and Decrement Operators
2. Operators in C
Arithmetic Operators
Increment Decrement Operators
Relational Operators
Logical Operators
Bitwise Operators
Assignment Operators
Conditional Operators
Special Operators
An operator is a symbol that tells the compiler to perform specific mathematical
or logical functions. C language is rich in built-in operators and provides the
following types of operators-
3. Arithmetic Operators
Operator Description Example
+ Performs addition of two operands. A+B=15
- Performs subtraction of two operands.
Subtract second operand from first.
A-B=5
* Performs multiplication of two operands. A*B=50
/ Performs division of two operands and
produces quotient as a result.
A/B=2
% Performs division of two operands and
produces remainder as a result.
A%B=0
Arithmetic operators are binary operators, means that they take
two operands to perform operation.
Here we consider two variables A=10 and B=5
4.
5. Increment and Decrement
Operators
Increment and decrement operators are unary operators
means that they can take one operand to perform operation
on it.
Increment operator add 1 to the variable and Decrement
operator subtracts 1 from the variable.
Pre-increment and pre-decrement add and subtract 1 to
and from the variable first and then perform assignment
operation.
Post-increment and post decrement do the assignment
operation first and then perform add and subtract 1 to and
from the variable.