Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- double cons, taxa;
- scanf("%lf", &cons);
- if(cons<=30)
- taxa = cons*0.05427+cons*0.08360,
- printf("Consumo mensal de energia menor ou igual 30 kWh\nPreco a ser pago: R$%.2lf\n", taxa);
- else if(cons<=100)
- taxa = cons*0.09304 +cons*0.14332,
- printf("Consumo mensal de energia entre 31 e 100 kWh(inclusive)\nPreco a ser pago: R$%.2lf\n", taxa);
- else if(cons<=220)
- taxa = cons*0.13956+cons*0.21498,
- printf("Consumo mensal de energia entre 101 e 220 kWh(inclusive)\nPreco a ser pago: R$%.2lf\n", taxa);
- else
- taxa = cons*0.15506+cons*0.23887,
- printf("Consumo mensal de energia maior que 220 kWh(inclusive)\nPreco a ser pago: R$%.2lf\n", taxa);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement