+ 1
Can some one explain the operator % in C# ?
I dont understand how it functions ?
3 odpowiedzi
+ 1
7 % 2
How often does the 2 fit whole into the 7?
3 times.
And what's left after that?
7-2*3 == 1
7%2 == 1
+ 1
You get the remainder of the division of operands. E. g. 11%3 = 2 because 11 = 3×3 + 2. Or 75%10=5 because 75 = 10×7 + 5
+ 1
Thank you guys very much !!