Hola buenas tardes a todos, les comparto mi codigo.
<meta charset="UTF-8">
<h3>¿Alcohol o gasolina?</h3>
<script>
var tanque = 40;
var recorridoconG = 480;
var consumodeG = recorridoconG/tanque;
var recorridoconA = 300;
var consumodeA = recorridoconA/tanque;
document.write("<h4>Consumo de gasolina!</h4>");
document.write("<br>");
document.write("El consumo de gasolina es: " + consumodeG + " KM/L.");
document.write("<br>");
document.write("<h4>Consumo de alcohol!</h4>");
document.write("<br>");
document.write("El consumo con alcohol es: " + consumodeA + " KM/L.");
</script>