sum = 0; while (n != 0) { sum += n % 10; n /= 10; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)