Skip to main content

Posts

Showing posts with the label #2. Write a Java program to find maximum between three numbers.

ads1

2. Write a Java program to find maximum between three numbers.

  2. Write a Java program to find maximum between three numbers. Static Solution  :- class max3 {     public static void main(String args[])     {     int no1=10,no2=20,no3=30;         if((no1 > no2) && (no2 > no3))         {             System.out.println("First number is Big :- "+no1);         }         else if(no2 >no3)         {             System.out.println("Second number is Big :- "+no2);         }     else     {         System.out.println("Third number is Big :- "+no3);     }     } }  Output :-  Dynamic Solution :-   import java.util.*; class max3d    {     public static void main(String args[])     {         int no1,no2,no3;           Scanner out = new Scanner(System.in);         System.out.println("Enter the first number :- ");         no1 = out.nextInt();         System.out.println("Enter the Second number :- ");         no2 = out.nextInt();         System.out.println("Enter the third number :- &

ads2