WAP to find largest among three numbers.

1 year ago
OOP Java

Compile code:

class Largestnumberofthreenumbers{
public static void main(String[] args) {
        
      int a = 5, b = 15,c=30;
      if(a>b&&a>c)
     System.out.println("Largest numbers is: "+a);
      else if(b>a&&b>c)
     System.out.println("Largest numbers is: "+b);
     else
     System.out.println("Largest numbers is: "+c);
    
   }
}

 

Output:

0
Dipti KC
Jan 8, 2023
More related questions

Questions Bank

View all Questions