Hola, les comparto una manera de resolverlo:
<meta charset="utf-8">
<h3>¿Alcohol o gasolina?</h3>
<script type="">
var tanque =40;
var kilometrosGasolina = 480;
var kilometrosAlcohol = 300;
var consumo = 0;
consumo = kilometrosGasolina / tanque
document.write("El consumo de gasolina es de: " + consumo + " km/l");
document.write("<br>")
consumo = kilometrosAlcohol/ tanque
document.write("El consumo de alcohol es de: " + consumo + " km/l");
</script>