From dedfa64bd9d19fe805dbc3e39ce5ef93d213071e Mon Sep 17 00:00:00 2001 From: Ruqayah Mousa Date: Sat, 24 Feb 2024 12:42:29 +0300 Subject: [PATCH] --- src/App.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/App.java b/src/App.java index 0a839f9..63bfedf 100644 --- a/src/App.java +++ b/src/App.java @@ -1,5 +1,20 @@ +import java.util.Scanner; + public class App { public static void main(String[] args) throws Exception { - System.out.println("Hello, World!"); + Scanner input = new Scanner(System.in); + System.out.println("Enter two integer numbers:"); + int num1 = input.nextInt(); + int num2 = input.nextInt(); + + if (num1 > num2) { + System.out.println("The first number is the greatest number:" + num1); + + } else if (num1 < num2) { + System.out.println("The second number is the greatest number:" + num2); + + } else { + System.out.println("The first number " + num1 + " is equal to the second number " + num2); + } } }