Python Program to Find the Sum of Digits in a given Number | find sum digit in given number in python |


Python Program to Find the Sum of Digits in a given Number | find sum digit in given number in python |



Python Program to Find the Sum of Digits in  a given Number 




Python Program to Find the Sum of Digits in a given Number | find sum digit in given number in python |
find sum digit in given number in python




n=int(input("Enter number:"))
sum=0
while(n>0):
    dig=n%10
    sum=sum+dig
    n=n//10
print("Sum of digits is :",sum)


Output-


Enter number:144
Sum of digits is : 9

Post a Comment

Post a Comment (0)

Previous Post Next Post