Muhaiminur
2/12/2018 - 3:39 PM

First_Number_Second_Number_Comparision

Write a java program that reads two integers from the user. Your program should then print “first is greater” if the first number is greater, and “first is not greater” otherwise.

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package BASICJAVA;

import java.util.Scanner;

/**
 *
 * @author ABIR
 */
public class First_Number_Second_Number_Comparision {
    public static void main(String[]args){
        Scanner abir =new Scanner(System.in);
        System.out.println("Enter your first number");
        int number1=abir.nextInt();
        System.out.println("Enter your second number");
        int number2=abir.nextInt();
        if(number1>number2){
            System.out.println("First is greater");
        }else{
            System.out.println("Second is not greater");
        }
        
    }
}