Java program to perform the relational operations
KW.java
class KW 
{
    public static void main(String args[]) 
    {
        float a=1,b=0;
        System.out.println("———————————————————————————————————————————");
        System.out.println("Program to perform the relational operations");
        System.out.println("———————————————————————————————————————————");
        System.out.println("Value Of a    | "+a);
        System.out.println("Value Of b    | "+b);
        System.out.println("Value Of a!=b | "+(a!=b));
        System.out.println("Value Of a>b  | "+(a>b));
        System.out.println("Value Of a>=b | "+(a>=b));
        System.out.println("Value Of a==b | "+(a==b));
        System.out.println("Value Of a<b  | "+(a<b));
        System.out.println("Value Of a<=b | "+(a<=b));
        System.out.println("———————————————————————————————————————————");
    }
}
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW ——————————————————————————————————————————— Program to perform the relational operations ——————————————————————————————————————————— Value Of a | 1.0 Value Of b | 0.0 Value Of a!=b | true Value Of a>b | true Value Of a>=b | true Value Of a==b | false Value Of a<b | false Value Of a<=b | false ——————————————————————————————————————————— kodingwindow@kw:~$
Advertisement