-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEjercicio 3.html
More file actions
34 lines (30 loc) · 880 Bytes
/
Ejercicio 3.html
File metadata and controls
34 lines (30 loc) · 880 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
<!DOCTYPE html>
<html lang=en dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<script>
var n1 = prompt("Ingrese el primer número");
var n2 = prompt("Ingrese el segundo número");
var operacion = prompt("¿Que desea realizar? +|-|*|/");
if (operacion === "+") {
document.write("La suma de "+ n1 + " y " + n2 + " es:");
document.write(parseInt(n1)+parseInt(n2));
}
else if (operacion === "-") {
document.write("La resta de "+ n1 + " y " + n2 + " es:");
document.write(parseInt(n1)-parseInt(n2));
}
else if (operacion === "*") {
document.write("La mmultiplicacion de "+ n1 + " y " + n2 + " es:");
document.write(parseInt(n1)*parseInt(n2));
}
if (operacion === "/") {
document.write("La division de "+ n1 + " y " + n2 + " es:");
document.write(parseInt(n1)/parseInt(n2));
}
</script>
</head>
<body>
</body>
</html>