Learn Programming
Learning new Things
Find Number of digits in Given Number In Python
Find Number of digits in Given Number In Python
Program:
n = int(input("Enter a number : "))
count = 0
while(n != 0):
n = int(n/10)
count = count + 1
print("Number of digits in Given Number is :",count)
OutPut:
Enter a number : 1224
Number of digits in Given Number is : 4
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment