public class RelationalOperators {
public static void main(String[] args) {
int x = 1;
int y = 3;
int z = 2;
boolean result;
System.out.println();//add a new line
System.out.println("Relational Operation:");
System.out.println();
System.out.println("Equal to:");
result = x==y; //checks if two values are equal
System.out.println(x+"=="+y+"="+result);
result =x==z;//checks if two values are equal
System.out.println(x+"=="+z+"="+result);
System.out.println();
System.out.println("Not Equal to:");
result=x!=y;//checks if two values are not equal
System.out.println(x+"!="+y+"="+result);
result =x==z;//checks if two values are equal
System.out.println(x+"!="+z+"="+result);
System.out.println();
System.out.println("Greater than:");
result=y>x;//checks if two the values are not equal
System.out.println(y+">"+x+"="+result);
result=x>z;//checks if the two values are equal
System.out.println(x+">"+z+"="+result);
System.out.println();
System.out.println("Less than:");
result=x<y;//checks if the two values are not equal
System.out.println(x+"<"+y+"="+result);
result=x<z;//checks if the two values are equal
System.out.println(x+"<"+z+"="+result);
System.out.println();
System.out.println("Greater than or Equal to:");
result=y>=x;//checks if two the values are not equal
System.out.println(y+">="+x+"="+result);
result=x>=z;//checks if the two values are equal
System.out.println(x+">="+z+"="+result);
System.out.println();
System.out.println("Less than or Equal to:");
result=x<=y;//checks if two the values are not equal
System.out.println(x+"<="+y+"="+result);
result=x<=z;//checks if the two values are equal
System.out.println(x+"<="+z+"="+result);
}
}
Sir ikaw tuh sir diba di ako nka subs sau niw plang haha