Saturday, March 19, 2022

Largest of Three Numbers

Program -

public class largestAmong3{

     public static void main(String []args){
        int x = 51, y = 11, z = 9;
        
        if(x >= y && x >= z)
            System.out.println(x);
        else if(y >= x && y >= z)
            System.out.println(y);
        else
            System.out.println(z);
     }
}

 

Video explanation -


 

 

No comments:

Post a Comment