import java.io.DataInputStream;
class Largest
{
                public static void main(String args[])
                {
                                DataInputStream in=new DataInputStream(System.in);
                                int  a=0,b=0,c=0;
                                try
                                {
                                                System.out.print("Enter First Number : ");
                                                a=Integer.parseInt(in.readLine());
                                                System.out.print("Enter Second Number : ");
                                                b=Integer.parseInt(in.readLine());
                                                System.out.print("Enter Third Number : ");
                                                c=Integer.parseInt(in.readLine());
                                }
                                catch(Exception e) {}
                                if(a>b && a>c)
                                                System.out.println(a+" Is Largest Number");
                                else if(b>c)
                                                System.out.println(b+" Is Largest Number");
                                else
                                                System.out.println(c+" Is Largest Number");
                }
}

JAVA 9.PNG

Advertisements