-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBIGGESTNUMBER.java
More file actions
27 lines (22 loc) · 866 Bytes
/
BIGGESTNUMBER.java
File metadata and controls
27 lines (22 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.mycompany.benit;
import java.util.Scanner;
public class BIGGESTNUMBER{
public static void main(String[] args) {
Scanner benit = new Scanner(System.in);
System.out.print("Enter the first number (A): ");
int A = benit.nextInt();
System.out.print("Enter the second number (B): ");
int B = benit.nextInt();
System.out.print("Enter the third number (C): ");
int C = benit.nextInt();
if (A > B && A > C) {
System.out.println(A + " is the largest number.");
} else if (B > A && B > C) {
System.out.println(B + " is the largest number.");
} else if (C > A && C > B) {
System.out.println(C + " is the largest number.");
} else {
System.out.println("Some numbers are equal.");
}
}
}