1. What is the difference between / and % operators? Give Suitable examples
Answers
Answered by
0
Explanation:
/ means devision.
% means percentage.
Answered by
2
Answer:
Well, / and % are two different mathematical operators in Java and both have different uses as well.
/ will simply perform the division operation as used in mathematics and gives result as quotient whereas % is known as modulus and gives the result as remainder of the division performed.
These operators can be understood by below examples:
10/2 will give the output as 5 which is the quotient of the above division.
But 11%2 will give the output as 1 which os the remainder of above performed modulus operation.
Similar questions