Computer Science, asked by shri8272, 1 year ago

write a program in Java with the help of scanner to accept three number and check whether they are different or not the program must display a message accordingly​

Answers

Answered by vanshvaish420
0

Explanation:

import java.util.*;

class k

{

public static void main (string args[])

{

scanner sc =new scanner(system.in);

int a =sc.nextInt();

int b=sc.nextInt();

int c=sc.nextInt();

if(a==b)

{

system.out.print ("a and b are same");

}

if(a==c)

{

system.out.print ("a and c are same");

}

if(b==c)

{

system.out.print ("b and c are same");

}

else

{

system.out.print ("they are different");

}}}

Similar questions