0
Hi 8%5what the answer why?
4 Respuestas
+ 7
I won't give you the exact answer, but I'll explain how it works.
% is called the modulus operator. It gives the remainder of the first value divided by the second value.
So what is the remainder of 8 / 5? 5 goes into 8 however many times, and then what's left of 8?
+ 3
The answer is 3. 8 divided by 5 is 1. with a remainder of 3. So the output of your code is 3.
+ 3
See my "% Modulus explained" code to understand in a way, you may have learnt at school
https://code.sololearn.com/c2fRl6x893E7/?ref=app
+ 2
simply it returns remainder ..