<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>teste</title>
</head>
<body>
<h1>Média de Consumo do combustivel</h1>
</body>
</html>
<script>
//tanque
var tanque = 40;
//KM PERCORRIDO
var caminhoComGasolina = 480;
var caminhoComAlcool = 300;
//consumo
var consumoDeAlcool = caminhoComAlcool/tanque;
var consumoDeGasolina = caminhoComGasolina/tanque;
document.write ("O consumo de Gasolina é " + consumoDeGasolina + " KM/L");
document.write ("<br>");
document.write ("O consumo de Alcool é " + consumoDeAlcool + " KM/L");
</script>