Special Operators

Arithmetic Operators are the operators which are used arithemetic operations like Addition , Subtraction, Multiplication, Division.
+ is used for Addition
- is used for Subtraction
* is used for Multiplication
/ is used for Division
% is used for Finding reminder of integer division

+ (Plus) Operator

+ operator is used to add two operands. Those operands may be integer , float or double datatypes. If we want to add to number ie 10 and 13 then we write 10 + 13. Similarly if we want to add values of a variable then we use a + b where a and b are the operands of type integer , float or double


result = 10 + 13 // result is 23
result = a + b // the result is equal to values of a + b

- (Minus or hihen)Subtraction Operator

- operator is used to subtract two operands difference is the result. Those operands may be integer , float or double datatypes. If we want to subtract to number ie 10 and 13 then we write 10 - 13. Similarly if we want to subtract values of a variable then we use a - b where a and b are the operands of type integer , float or double

result = 10 - 13 // result is -3
result = a - b // the result is equal to values is difference of a , b

* (Asterik) Multiplication Operator

* operator is used to multiply two operands , product is the result. Those operands may be integer , float or double datatypes. If we want to multiply to number ie 10 and 13 then we write 10 * 13. Similarly if we want to multiply values of a variable then we use a * b where a and b are the operands of type integer , float or double

result = 10 * 13 // result is 230
result = a * b // the result is equal to product of a , b

/ Division Operator

/ operator is used to do division on two operands quotient is the result. Those operands may be integer , float or double datatypes. If we want to divide to number ie 10 and 13 then we write 10 / 13. Similarly if we want to add values of a variable then we use a / b where a and b are the operands of type integer , float or double

result = 10 / 13 // result is 0.1
result = a / b // the result is equal to quotient of a / b

% Modulus Operator

% opeator is used to find reminder after integer division of two operands. Those operands must be integers only. If we want to add to number ie 10 and 3 then we write 10 % 3. Similarly if we want to find reminder of a variables then we use a % b where a and b are the operands of type integer.

result = 10 % 3 // result is 1
result = a % b // the result is equal to reminder of a / b