Mode Gelap

Recent in Fashion

Best Seller Books

Sum of Squares of Each Digit

  • 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 Output
    210
  • Test Case 2

    Input (stdin)
    5398

    Expected Output
    179

Subscribe Our Newsletter

avatar
"By speaking behind my back, it means that you respect my existence enough not to act in front of my face."

Related Posts

0 Comment

Post a Comment

Article Top Ads

Parallax Ads

Article Center Ads

Article Bottom Ads