Let me explain my way | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Let me explain my way

7%(5//2) Now let's start with the parentheses 5÷2 = in this case we are looking for the first Number out put and ignoring the reminder or finishing the division in the right proper way, so the answer would be 2 because 2×2 is 4 which is the closest answer, and now we will not finish the solution because that what // does. Now, 7÷2 = we will look for the reminder of the division, so the answer would be 1, why 1? Because you will use 3×2 = 6 then 7-6=1. That's what % does.

27th Mar 2018, 12:17 AM
Medo Hamdani
Medo Hamdani - avatar
3 Answers
+ 1
7%2 , here desired output is only remainder. above term is expressed by modulus sign (%),where % shows only remainder,not shows quotient.So quotient 3 isn't shown. It's expressed by 7%2 = 1
27th Mar 2018, 3:08 AM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 1
Why down vote? if you have courage, please give your logic?
27th Mar 2018, 4:01 AM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
- 1
very nice.
27th Mar 2018, 2:26 AM
Karlos Allan Lopes
Karlos Allan Lopes - avatar