-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdois.java
More file actions
24 lines (18 loc) · 720 Bytes
/
dois.java
File metadata and controls
24 lines (18 loc) · 720 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
import java.util.Scanner;
public class dois {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Digite o primeiro valor: ");
double a = scanner.nextDouble();
System.out.print("Digite o segundo valor: ");
double b = scanner.nextDouble();
while (b == 0) {
System.out.println("VALOR INVALIDO");
System.out.print("Digite um novo segundo valor: ");
b = scanner.nextDouble();
}
double resultado = a / b;
System.out.println("Resultado da divisao: " + resultado);
scanner.close();
}
}