<?php
<?php
$ventas_dia = array (120.25, 85.05, 90.36, 98.95, 102.51,
79.17, 89.55, 80.69, 86.77, 115.85,
124.25, 92.24, 94.97, 112.73, 127.85,
100.05, 105.42, 91.12, 99.51, 95.63
);
$total = 0;
for ($i=0; $i<=count($ventas_dia)-1; $i++) {
$total += $ventas_dia[$i];
}
$promedio = $total / count($ventas_dia);
echo 'El promedio de ventas es: ' . $promedio;
?>
- Output for 7.1.0 - 7.1.15, 7.2.0 - 7.2.3
- Parse error: syntax error, unexpected '<', expecting end of file in /in/bfbor on line 2
Process exited with code 255.
preferences:
169.19 ms | 1411 KiB | 27 Q