Problem Description
Write a program to read a positive integer and find the sum of squares of individual digits.CODING ARENA
n=int(input())
tot=0
while(n>0):
dig=n%10
tot=tot+dig*dig
n=n//10
print(tot)
Test Case 1
Input (stdin)8974
Expected Output210
Test Case 2
Input (stdin)5398
Expected Output179
No comments:
Post a Comment