Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Write a program to find the sum of digits of an integer number, input by the

Ans.

num = int(input("Enter number: "))

ssum = 0

nnum = num

while (nnum != 0):

digit = nnum % 10;

nnum = nnum // 10

ssum += digit

print("Sum of digits of number", num, "is :", ssum

You might also like