import java.io.DataInputStream;
class Largest
{
                public static void main(String args[])
                {
                                DataInputStream in=new DataInputStream(System.in);
                                int l=0,j=0,c=0;
                                try
                                {
                                                System.out.println("Enter Ten Integer Number : ");
                                                for(c=0;c<10;c++)
                                                {
                                                                j=Integer.parseInt(in.readLine());
                                                                if(j>l)
                                                                                l=j;
                                                }
                                }
                                catch(Exception e) {}
                                System.out.println("Largest Number = "+l);
                }
}

JAVA 11.PNG

Advertisements