ShriRam Changed status to publish August 18, 2023
num = int(input(“Enter a number: “))
sum = 0
temp = num
while temp > 0:
digit = temp % 10
sum += digit
temp //= 10
print(sum)
ShriRam Changed status to publish August 18, 2023