-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exercise11.html
33 lines (25 loc) · 1.06 KB
/
Exercise11.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Exercise 11</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script type="text/javascript">
// Crear un programa que reciba 3 números e indique cuál es el mayor y el menor.
let number1 = parseInt(prompt('Ingrese el primer numero'));
let number2 = parseInt(prompt('Ingrese el segundo numero'));
let number3 = parseInt(prompt('Ingrese el tercer numero'));
function maxAndMin(number1, number2, number3) {
let maxNumber = Math.max(number1, number2, number3);
let minNumber = Math.min(number1, number2, number3);
let result = `El mayor es ${maxNumber}, y el menor es ${minNumber}`;
return result;
}
alert(maxAndMin(number1, number2, number3));
</script>
</body>
</html>