+ 3

why 10%23=10???please help.

#include <stdio.h> #include <stdlib.h> int main() //why r1=10; {int r,r1; r=23%10; r1=10%23; printf("%d\n",r); printf("%d\n",r1);// why 10//10%23 return 0; }

22nd Jun 2020, 6:59 AM
Coding San
Coding San - avatar
1 Réponse
+ 3
Coding Gl Because 10 is not divisible by 23 so reminder will be 10. 10 is reminder value. 10 % 23 = 23 * 0 + 10 = 10 23 % 10 = 10 * 2 + 3 = 23// here reminder is 3 so answer will be 3 See this tutorial https://www.programiz.com/c-programming/examples/remainder-quotient#:~:text=quotient%20%3D%20dividend%20%2F%20divisor%3B,are%20displayed%20using%20printf(%20)%20.
22nd Jun 2020, 7:02 AM
A͢J
A͢J - avatar