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);
}
}
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);
}
}
Good job
ReplyDelete