Advertisement
Anon017706349

Untitled

Oct 9th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. int numSquareSum(int n)
  2. {
  3. int squareSum = 0;
  4. int digit = 0;
  5. while (n!= 0)
  6. {
  7. digit = n % 10;
  8. squareSum += digit * digit;
  9. n /= 10;
  10. }
  11. return squareSum;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement