Java program using scanner class method
Write a program to input three integer and check whether all of them are unique (different) from each other or not.
Answers
Answered by
7
import java.util.*;
public class Number
{
public static void main(String args[])
{
Scanner in= new Scanner(System.in);
int a,b,c;
System.out.println("Enter the value of a");
a=in.nextInt();
System.out.println("Enter the value of b");
b= in.nextInt();
System.out.println("Enter the value of c");
c=in.nextInt();
if(a != b && b!=c && c!= a)
{
System.out.println("They are unique");
}
else
Sytem.out.println("They are not unique");
}
}
Similar questions