0

Anyone to speak to me? I still dont understand how to calculate the remmainder of a number

x%2. if two is the number which we gonna calcutate his multiple, 2 have an infinity interger multiples. what does this operator do exactly??

25th Mar 2018, 6:21 PM
Miguel Kiâmpuku Sebastião
Miguel Kiâmpuku Sebastião - avatar
6 Respostas
+ 1
is amazing how quickly i get the answers seconds latter i made the post
25th Mar 2018, 7:05 PM
Miguel Kiâmpuku Sebastião
Miguel Kiâmpuku Sebastião - avatar
+ 1
very good community of people who just want to help
25th Mar 2018, 7:07 PM
LordHill
LordHill - avatar
0
x % y returns the remainder of x / y. x = 4, y = 2 would return 0 because 4 / 2 has no remainder. x = 5, y = 2 would return 1 because 5 / 2 is 2 with a remainder of 1.
25th Mar 2018, 6:37 PM
Adam
Adam - avatar
0
9%2 .. Remainder is 1 2-4-6-8 .. 1 remaining 14%3 .. Remainder is 2 3-6-9-12 .. 2 Remaining Often used to differentiate odds and even. If n%2==0 then n must be an even number. If n%2!=0 then n must be an odd number.
25th Mar 2018, 6:41 PM
LordHill
LordHill - avatar
0
Thank you all for clear my doubts
25th Mar 2018, 7:03 PM
Miguel Kiâmpuku Sebastião
Miguel Kiâmpuku Sebastião - avatar