Here is Java Program to check greater between two no.
Output of Above Java Program
Enter the 1st no.:
45
Enter the 2nd no.:
85
The result of the operation a>b is false.
import java.io.*; class optr{ public static void main(String args[]) throws IOException { int a,b; boolean c; DataInputStream din= new DataInputStream(System.in); System.out.println("Enter the 1st no.: "); a=Integer.parseInt(din.readLine()); System.out.println("Enter the 2nd no.: "); b=Integer.parseInt(din.readLine()); c=a>b; System.out.println("The result of the operation a>b is " +c+"."); } }
Output of Above Java Program
Enter the 1st no.:
45
Enter the 2nd no.:
85
The result of the operation a>b is false.