Loops concept-Sum of a digits of a number

n%10 concept I didn’t understand the concept of %

@chinnathumbalam.tarun121
% represents the mathematical modulo operator. This is simply an operator to find the remainder after dividing the first number by the second.

7%5 = 2
If you divide 7 by 5 , the remainder is 2

13%3 = 1
Divide 13 by 3 , remainder is 1

55%4 = 3
21%2 = 1
45%5 = 0

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.