Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define ff 500
- int main()
- {
- float PP = 0;
- int c;
- do
- {
- printf("Donner la consommation en KWH : ");
- scanf("%d",&c);
- } while (c<=0);
- if (c<=100)
- {
- PP = c*70 + ff;
- }
- else if (c>100 && c<=250)
- {
- PP = 100*70 + (c-100)*85 + ff;
- }
- else
- {
- PP = 100*70 + 150*85 + (c-150)*95 + ff;
- }
- printf("Le montant à payer est : %.3f",PP);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement