Problem Statement - division versus modulus operator

Write one difference between / and % operator.

Solution

TC++ #4104

when / (division) operator is used we get the value of numerator (value before /) divided by denominator (value after /). In case of % (modulus) operator we get the remainder of division operation as done in the previous case.

Notes

Unlike many other languages like c/c++, java allows % operation for float and double also, but one has to take care regarding the rounding off errors due to precision range.