Computer Applications
What is the difference between / and % operator?
Java Operators
ICSE 2011
114 Likes
Answer
/ | % |
---|---|
Division operator | 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
63 Likes