Type Here to Get Search Results !

Java Program to check greater between two numbers

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.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad