class relationaloperators
{
public static void main(String[] args)
{
int res;
Scanner obj = new Scanner(System.in);
System.out.println("enter first number : ");
int no1 = obj.nextInt();
System.out.println("enter second number : ");
int no2 = obj.nextInt();
if(no1>no2)
{
System.out.println("no1 is greater than no2");
}
if(no1<no2)
{
System.out.println("no1 is lesser than no2");
}
if(no1>=no2)
{
System.out.println("no1 is either greater or equal than no2");
}
if(no1<=no2)
{
System.out.println("no1 is either lesser or equal than no2");
}
if(no1==no2)
{
System.out.println("no1 is equal to no2");
}
if(no1!=no2)
{
System.out.println("no1 is not equal to no2");
}
if(obj instanceof Scanner)
{
System.out.println("obj is instance of Scanner class");
}
}
}
OUTPUT
Comments
Post a Comment