Computer Applications
Distinguish between the following:
/ and % operator
Java Operators
6 Likes
Answer
/ | % |
---|---|
It is the Division operator | It is the Modulus operator |
Returns the quotient of division operation | Returns the remainder of division operation |
Example: int a = 5 / 2; Here a will get the value of 2 which is the quotient of this division operation | Example: int b = 5 % 2; Here b will get the value of 1 which is the remainder of this division operation |
Answered By
5 Likes