Python program to find the smallest digit of a given number


Write a program in python to find the smallest digit of a given number

---------------------------------------------

n=int(input("Enter any Number : "))

min=9

while n>0:

    digit=n%10

    if min>digit:

        min=digit

        n=n//10

print("Smallest Digit is : ",min)

---------------------------------------------

output :-

Enter any Number : 6587

Smallest Digit is :  5

Post a Comment

0 Comments