-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise2.html
More file actions
36 lines (29 loc) · 1.27 KB
/
Exercise2.html
File metadata and controls
36 lines (29 loc) · 1.27 KB
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>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Exercise 2</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script type="text/javascript">
//Crea un programa que solicite dos números y muestre los resultados de todas sus operaciones aritméticas
let number1 = parseInt(prompt('Ingrese un numero'));
let number2 = parseInt(prompt('Ingrese otro numero'));
function aritmethicOperation(param1, param2) {
let operations2 = [
`${param1} + ${param2} = ${param1 + param2}`,
`${param1} - ${param2} = ${param1 - param2}`,
`${param1} * ${param2} = ${param1 * param2}`,
`${param1} / ${param2} = ${param1 / param2}`,
`${param1}** ${param2} = ${Math.pow(param1, param2)}`,
`${param1} % ${param2} = ${param1 % param2}`,
];
return operations2.join('<br/>');
}
document.write(aritmethicOperation(number1, number2));
</script>
</body>
</html>