Pages

Write a program for electricity bill [Updated]

Friday 19 April 2013


PROGRAM OF ELECTRICTY BILL(NOTE: IT IS APPLICABLE UNDER 200 UNITS )

#include<stdio.h>
#include<conio.h>
int main()
{
float current_unit,previous_unit,UNIT,BILL,TOTAL1,TOTAL2, GREATER_THAN_100,F_100;
float NEELAMCHARGE;
float GENERAL_SALE_TAX,ELECRICITY_DUTY,PTV_FEE;
printf("enter the current unit\n");
scanf("%f",&current_unit);
printf("enter the prevoius unit\n");
scanf("%f",&previous_unit);
//UNIT=(current_unit-previous_unit);
//printf("The unit which is consumed in 1 month %f\n",UNIT);
printf("NEELAMCHARGE\n");
scanf("%f",&NEELAMCHARGE);
printf("GENERAL_SALE_TAX\n");
scanf("%f",&GENERAL_SALE_TAX);
printf("ELECRICITY_DUTY\n");
scanf("%f",&ELECRICITY_DUTY);
printf("PTV_FEE\n");
scanf("%f",&PTV_FEE);

UNIT=(current_unit-previous_unit);
printf("The unit which is consumed in 1 month %f\n",UNIT);
if(UNIT<=100){
TOTAL1=(UNIT*5.790);
printf("the bill less than and equal to 100 unit is =%f\n",TOTAL1);
}
else{
GREATER_THAN_100=UNIT-100;

printf("the unit greater than 100 is =%f\n", GREATER_THAN_100);
TOTAL2=(GREATER_THAN_100*8.110)+(NEELAMCHARGE)+(GENERAL_SALE_TAX)+(ELECRICITY_DUTY)+(PTV_FEE);
}
F_100=5.790*100;
BILL=F_100+TOTAL2;
printf("electricity bill is %.4f\n",BILL);
getch();
}
 

Search Box

Most Reading

Contact Form

Name

Email *

Message *