Skip to content

Instantly share code, notes, and snippets.

@morbidcamel101
Created January 10, 2017 22:00
Show Gist options
  • Save morbidcamel101/afad0c617da885a26100d2b62dccf313 to your computer and use it in GitHub Desktop.
Save morbidcamel101/afad0c617da885a26100d2b62dccf313 to your computer and use it in GitHub Desktop.
Sum of Digits
sum = 0;
while (n != 0) {
sum += n % 10;
n /= 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment