Created
January 30, 2019 15:53
-
-
Save belyaev-pa/f5ba862550895d76c184540644f20efb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static private int NumberSum(int number) | |
{ | |
int sum = 0; | |
while(number != 0) | |
{ | |
sum += number % 10; | |
number /= 10; | |
} | |
return sum; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment