-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreatestOfhree.java
More file actions
28 lines (19 loc) · 815 Bytes
/
Copy pathGreatestOfhree.java
File metadata and controls
28 lines (19 loc) · 815 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
28
import java.util.Scanner;
public class GreatestOfhree {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Please Enter First numbers: ");
double num1 = in.nextDouble();
System.out.print("Please Enter Second numbers: ");
double num2 = in.nextDouble();
System.out.print("Please Enter Three numbers: ");
double num3 = in.nextDouble();
if(num1 >= num2 && num1 >= num3 ){
System.out.println(num1 + " is the greatest of three numbers ");
}else if(num2 >= num1 && num2 >= num3){
System.out.println(num2 + " is the greatest of three numbers ");
}else{
System.out.println(num3 +" is the greatest of three numbers");
}
}
}