Greatest Among three number in Java with Flowchart || Advanced Java Program


 Flowchart:-



 Program:-

import java.util.Scanner;

public class first

{

         public static void main(String[] args)

     {


         int a, b, c;       


         Scanner obj = new Scanner(System.in);


         System.out.print("Enter three numbers: ");


         a = obj.nextInt();


         b =obj.nextInt();


         c = obj.nextInt();

        

         if((a > b) && (a > c))


               System.out.print(" Greater number among "+a+","+b+","+c+" is "+a);


         else if((b > a) && (b > c))


               System.out.print("Greater number among "+a+","+b+","+c+" is "+b);


      else if ((c > a) && (c > b))


               System.out.print("Greater number among "+a+","+b+","+c+" is "+c);


        else


               System.out.println("Not applicable");


      }


}


 Output:-





If you have any problems then contact us in  our 

Whatsapp group:-Join  Click join to join our group.

Join our Facebook group:- Join Click join to join our group.




No comments:

Post a Comment

theengineerschoice01@gmail.com