KnowledgeBoat Logo

Computer Applications

Distinguish between the following:

/ and % operator

Java Operators

6 Likes

Answer

/%
It is the Division operatorIt is the Modulus operator
Returns the quotient of division operationReturns 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 operationExample: int b = 5 % 2; Here b will get the value of 1 which is the remainder of this division operation

Answered By

5 Likes


Related Questions