2. Write a program in java to find a largest number out of two numbers?

class Largest
{
                public static void main(String args[])
                {
                                int a=7,b=9;
                                if(a>b)
                                                System.out.println(a+" Is Greater Than "+b);
                                else
                                                System.out.println(b+" Is Greater Than "+a);
                }
}

JAVA 2.PNG

Advertisements

Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: