+ 1
i need help understanding the modulus operator (%)
'm trying to learn C# and not knowing how this operator works is making it really hard for me to learn C#. I tried to go back to basic concepts to figure it out and looked at the commits explaining how it works but I just can't seem to understand it and that really bothers me. Can anyone PLZ help me understand how the modulus operator works, I'm kinda a slow learner.
3 Réponses
+ 3
The modulus operator gives the value of remainder when you divide two numbers.. For example 7%5 gives 2..similarly 4%2 gives zero as the remainder is zero
+ 2
Check this out
https://www.sololearn.com/discuss/404704/?ref=app
+ 2
modulus operator in any program simply means the division of two numbers with a remainder.