-1
#include <stdio.h>
int main()
{
float aguagasta, price, total;
printf("Digite o valor de agua [em metros cubicos] gasta em sua casa:\n");
scanf("%f", &aguagasta);
if (aguagasta < '20' && aguagasta > 0)
{
price = 8.50;
}
else
{
price = 11;
}
aguagasta * price = total;
printf("Voce tera que pagar %f.", total);
}
The program goes through the Debugger, but does not run normally, whenever I type any value, comes out 0.000000 in the final result. Please help.
yes, no value has ever been assigned to total. Is the total line not envied? would it be
total = aguagasta * price;
?– Ricardo Pontual