How can this calculation would be equal to 1, print(1%2), Output 1 pls proof. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

How can this calculation would be equal to 1, print(1%2), Output 1 pls proof.

Help

31st Oct 2020, 7:13 AM
Muhammad Abdulmalik
Muhammad Abdulmalik - avatar
2 Answers
+ 8
When u will divide 1 by 2 ,u will get 1 as remainder. So outputs 1. %=>gives remainder
31st Oct 2020, 7:18 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 1
when the right side of % (2) sign is greater than the left side (1) , it will return the right side , so example : 4%5 =4 but 5%4= 1 Hope this help
31st Oct 2020, 8:35 AM
Med Amine Fh
Med Amine Fh - avatar