Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float units, sc=100, vat=15, bill; // sc = service charge, vat 15% if total bill is more than 400.
- printf("Please give your Used Electric Units\n");
- scanf("%f", &units);
- if(units >= 0 && units <= 200){
- bill = (units*0.8)+sc;
- } else if(units > 200 && units <= 300){
- bill = (units*0.9)+sc;
- } else {
- bill = (units*1)+sc;
- }
- if(bill >= 400){
- bill = bill + (bill*(vat/100));
- }
- printf("Your Total Payable Bill is %.2f Tk.", bill);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement