if (a >= 10) a %= 10;
it's means that if the new number (a + b) is larger than 10 we take only the right digit (Modulo 10).
for example (assuming that the numbers are integers):
14 / 10 = 1....
|CodeGuru Home||VC++ / MFC / C++||.NET / C#||Visual Basic||VB Forums||Developer.com|
Type: Posts; User: you69
Search: Search took 0.02 seconds.
Results 1 to 3 of 3
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!