estudiante
Publicado por diego (1 intervención) el 17/06/2021 02:12:22
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
<!DOCTYPE html>
<html>
<head>
<title>Ejemplo de JavaScript</title>
<meta charset="UTF-8">
</head>
<body>
<script>
var f;
var base;
var altura;
var superficie;
var conta1=0;
for(f=1;f<=3;f++)
{
base=prompt('Ingrese la base:','');
base=parseInt(base);
altura=prompt('Ingrese la altura:','');
altura=parseInt(altura);
superficie=base*altura/2;
if (superficie>12)
{
conta1++;
}
document.write('Triángulo nro:'+f+'<br>');
document.write('Base:'+base+'<br>');
document.write('Altura:'+altura+'<br>');
document.write('Superficie:'+superficie+'<br>');
}
document.write('Cantidad de triángulos con superficie mayor a 12:'+conta1);
</script>
</body>
</html>
Valora esta pregunta


-2