What does the code (10%2)
mean?
Asked
Active
Viewed 5.0k times
-1

johnnyRose
- 7,310
- 17
- 40
- 61

shujaat
- 105
- 2
- 2
- 6
-
4Please use a more descriptive question title next time--e.g. "What does % mean?" – Lèse majesté Aug 21 '10 at 07:11
-
2It's a way to write `0`. – Pascal Cuoq Aug 21 '10 at 09:38
-
3@Lese majeste So he should use a less descriptive, ambiguous title like "What does % mean?". % can mean a number of things, including percentage... – alternative Aug 21 '10 at 17:56
5 Answers
2
The modulus operator (%)
computes the remainder after dividing its first operand by its second.

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
1
10%2 is 0, 10 divided by 2, rest is 0. This can also mean that number is even.

Dejan Marjanović
- 19,244
- 7
- 52
- 66