Skip to content

Instantly share code, notes, and snippets.

@belyaev-pa
Created January 30, 2019 15:53
Show Gist options
  • Save belyaev-pa/f5ba862550895d76c184540644f20efb to your computer and use it in GitHub Desktop.
Save belyaev-pa/f5ba862550895d76c184540644f20efb to your computer and use it in GitHub Desktop.
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