Java Program to Find Greater Number

Here is a simple java program to find greater and smaller number…

class greater_lesser3
{
    public static void main(int a,int b,int c)
    {
        if (a>b && a>c)
        {
        System.out.println(“The Greater No is:”+a);
        }
        else if (b>c && b>a)
        {
        System.out.println(“The Greater No is:”+b);
        }
        else if (c>a && c>b)
        {
        System.out.println(“The Greater No is:”+c);
        }
        if (a        {
        System.out.println(“The Lesser No is:”+a);
        }
        else if (b        {
        System.out.println(“The Lesser No is:”+b);
        }
        else if (c
        {
        System.out.println(“The Lesser No is:”+c);
        }
    }
}

Add Comment