:
Q.14 differentiate between / and % operators in JAVA.
Answers
Answered by
1
Answer:
/ This a binary operator i.e., it operates on two operants. It is used to symbolize divide in Java. eg: int a=10,b=2;
double c=a/b;
% It is another binary operator. In division we get the quotient as answer but in % we get the remainder as the answer. And if the numerator is less than the denominator the answer is the numerator.
eg: int a=2, b=10;
double c=a%b;
output=2
Similar questions