What is the % operator

It is referred to as the modulo or remainder operator. It returns the remainder of dividingthe first operand by the second operand.

Showing Answers 1 - 3 of 3 Answers

1.For integer remainder operation, where only integer operands are involved, evaluation of the expression (x % y) always satisfies the following relation:


x == (x / y) * y + (x % y)
2.The floating-point remainder r is defined by the relation:


r == a - (b * q)

where a and b are the dividend and the divisor, respectively, and q is the integer quotient of (a/b).

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions