how the modulo % operator works with floating numbers in java
Answers
Answered by
1
Answer:
Modulo Operator is one of the fundamental operators in Java. It's a binary operator i.e. it requires two operands. In a division operation, the remainder is returned by using modulo operator. It is denoted by % (percentage) sign. For example 5%2 will return 1 because if you divide 5 with 2, the remainder will be 1. For a programmer it's very important to know how to use this operator, they are very important to build logic. For example, in many cases like reversing a number or checking if a number is a palindrome, you can use modulus operator with 10 to get the last digit,
Hopefully it will help you
Similar questions
Math,
2 months ago
History,
2 months ago
Social Sciences,
6 months ago
English,
6 months ago
Computer Science,
11 months ago
Political Science,
11 months ago
Political Science,
11 months ago