-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx02.java
More file actions
36 lines (24 loc) · 674 Bytes
/
Copy pathEx02.java
File metadata and controls
36 lines (24 loc) · 674 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
29
30
31
32
33
34
35
36
/*
Escreva um programa que efetue a leitura de três valores reais R, S e T, imprimindo qual deles é o maior.
*/
import java.util.Scanner;
public class Ex02 {
public static void main(String[] args) {
System.out.println("Digite 3 numeros: ");
Scanner leia = new Scanner(System.in);
float R = leia.nextFloat();
float S = leia.nextFloat();
float T = leia.nextFloat();
float maiorNum;
if ((R > S) && (R > T)){
maiorNum=R;
}
if ((S > R) && (S > T)){
maiorNum=S;
}
else {
maiorNum=T;
}
System.out.println("O maior num eh " + maiorNum);
}
}