-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif1.java
More file actions
38 lines (25 loc) · 761 Bytes
/
Copy pathif1.java
File metadata and controls
38 lines (25 loc) · 761 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
37
38
package LacosCondicionais;
import java.util.Scanner;
public class if1 {
public static void main(String[] args) {
Scanner leia = new Scanner(System.in);
int n1,n2,n3,resultado;
System.out.println("Digite o numero A: ");
n1 = leia.nextInt();
System.out.println("Digite o numero B: ");
n2 = leia.nextInt();
System.out.println("Digite o numero C: ");
n3 = leia.nextInt();
resultado=(n1+n2);
System.out.println("\nA + B " +resultado );
if(resultado>n3) {
System.out.println("\nA soma de A + B é maior do que C!!!");
}
else if(resultado<n3) {
System.out.println("\nA soma de A + B é menor do que C!!!");
}
else if(resultado==n3) {
System.out.println("\nA soma de A + b é igual a C!!!");
}
}
}