0

why 7%2 =1?

why does 7% (5//2)=1 i know 5//2 =2 so why 7%2 =1?

20th Jan 2017, 1:38 PM
Mohamed Ahmed Salem
5 ответов
+ 2
it means the balance after 7 divide by 2...the "%" symbol just want the balance but not the answer which is 7/2=3 balance 1
20th Jan 2017, 1:49 PM
Blugon
Blugon - avatar
0
now I understand when 7%2 we can see how many 2in 7 and result is the remain it is as : 7-2 =5 5-2 =3 3 - 2 =1 so the answers =1
20th Jan 2017, 2:28 PM
Mohamed Ahmed Salem
0
yes
20th Jan 2017, 2:33 PM
Blugon
Blugon - avatar
0
7%2 means 7 modulo 2. Which gives the value of remainder by dividing 7 with 2. When we divide 7 by 2 it gives us 2 as the quotient and 1 reminder. Thus the answer is our remainder 1.
20th Jan 2017, 2:47 PM
Khodat
Khodat - avatar