<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Consumo de combustibles</title>
</head>
<body>
<h3>¿Alcohol o gasolina?</h3>
<script>
var tanque = 40;
var gasolina_km = 480;
var alcohol_km = 300;
var gasolina = Math.round(gasolina_km / tanque);
var alcohol = Math.round(alcohol_km / tanque);
document.write(
"El rendimiento de gasolina por kilometro es: " + gasolina + "<br>"
);
document.write("<br>");
document.write(
"El rendimiento de alcohol por kilometro es: " + alcohol + "<br>"
);
</script>
</body>
</html>