Blog

Arithmetic Operators

Arithmetic operators

It uses to perform arithmetic or in other words to perform mathematical operations

There are two types of arithmetic operators

UnaryUnary operators performs operations with single operand

BinaryBinary operators performs operations between two operands

Tabular representation of all Arithmetic operations below:

Operators Mathematical 
Operator
Operational TypeDescriptionExample
+BinaryAdditionAdds two operandsX+Y
BinarySubtractionSubtracts two operandsX-Y
*BinaryMultiplicationMultiplies two operandsX*Y
/BinaryDivisionDivides the first operand by the secondX/Y
%BinaryModulusFirst operand is divided by the second and retruns the reminderX%Y
++UnaryIncrementIncrements the value of an integer(X++ is Post-increment, ++X is Pre-increment)X++,++X
– –UnaryDecrementDecrements the value of an integer(Y- – is Post-decrement, – -Y is Pre-decrement)Y- -,- -Y

Leave a Reply

Your email address will not be published. Required fields are marked *