We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aa90a0 commit 7c40258Copy full SHA for 7c40258
Largest_Number
@@ -0,0 +1,15 @@
1
+import java.util.Scanner;
2
+public class Largest_Number {
3
+ public static void main(String[] args) {
4
+ Scanner scanner = new Scanner(System.in);
5
+ System.out.print("Enter first number: ");
6
+ int num1 = scanner.nextInt();
7
+ System.out.print("Enter second number: ");
8
+ int num2 = scanner.nextInt();
9
+ System.out.print("Enter third number: ");
10
+ int num3 = scanner.nextInt();
11
+ int largest = (num1 > num2) ? ((num1 > num3) ? num1 : num3) : ((num2 > num3) ? num2 : num3);
12
+ System.out.println("Largest number is: " + largest);
13
+ scanner.close();
14
+ }
15
+}
0 commit comments