program to find smallest digit of a number(using java)

 class smallest 

{

public static void main(String args[])

{

int  no=125, small=9,b=0;

while(no>0)

{

b=n0%10;

no=no/10;

if(b<small)

small=b;

}

System.out.println(small);

}

}

Comments

Post a Comment

Popular posts from this blog