Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

sum the digits in c#

sum = 0;
while (n != 0) {
    sum += n % 10;
    n /= 10;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #digits
ADD COMMENT
Topic
Name
4+3 =