write a computer program to enter one no. and find the second largest digit of that no. eg-894,the second largest is 8.
plz answer
Answers
Answered by
1
Answer:
import java.util.*;
class number
{
public static void (String args[])
{
Scanner SC = new Scanner (system.in);
int n=sc.nextInr();
while (n! = 0)
{int m=1;
int d=n%10;
n=n/10;
if(d<m)
m=d
system.out. ("greatest digit"+m);
}
}
}
Similar questions