Monday, 27 April 2020

Greatest among three values


Write a program to display the greatest value among three values.

class  Great
{
    public static void main(String arg[])
    {
        Int   a = 7,   b = 13 ,   c = 11 ;
       
        if(a>b && a>c)
        {
            System.out.println(" A is greater");
        }       
        else if(b>a && b>c)
        {
             System.out.println(" B is greater ");
        }
        else
        {
            System.out.println("C is greater");
        }     
    }
}


12 comments: