C Programming Language


Operator


An operator is a specific symbol that instruct to the compiler for perform specific mathematical or logical function. C language have built-in operators as per following types of operators:

Arithmatic Operator :

Arithmetic operators are used to perform mathematical expressions. Below table shows the arithmetic operators:
Assume integer variable X holds 10 and variable Y holds 20, then:

Operator Descriptions Example
+ Adding the two operand X + Y will give 30
- Subtracting second operand from the first X - Y will give -10
* Multiplication of two operands X * Y will give 200
/ Division of numerator by de-numerator Y / X will give 2
% Moduluung Operator and remainder of an integer division Y % X will give 0
++ Increment operator X++ will give 11
-- Decrement operator X-- will give 9

Example :

Output :

Line 1 - Value of z : 31
Line 2 - Value of z : 11
Line 3 - Value of z : 210
Line 4 - Value of z : 2
Line 5 - Value of z : 1
Line 6 - Value of z : 21
Line 7 - Value of z : 22