Computer Science, asked by ajeetsingharora0324, 8 months ago

Write a program to input 3 numbers and check
whether they are equal or not. If they are unequal
then display the greatest among them otherwise
display the message " All the members are equal."

Answers

Answered by kaurmanveer
5

Answer:

public class Main

{

public static void main(String[] args) {

    int a,b,c;

    Scanner s=new Scanner(System.in);

    System.out.println("enter the first number");

    a=s.nextInt();

    System.out.println("enter the second number");

    b=s.nextInt();

    System.out.println("enter the third number");

    c=s.nextInt();

    if(a==b&& b==c){

     System.out.println("all number are equal");}

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

     {

         System.out.println("first number is greater all of them"+a);

     }

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

            System.out.println("second number is greater all of them"+b);

     }

     else{

         System.out.println("third number is greater all of them"+c);

     } }

Explanation:

Similar questions