Saturday, February 1, 2020

Bill Program

#include <stdio.h>
#include <conio.h>

int main()
{
int pvunit, ptunit, unit;
float amt, total_amt, tax;

printf("Enter total Previous units: ");
scanf("%d", &pvunit);

printf("Enter total Present units: ");
scanf("%d", &ptunit);

unit=ptunit-pvunit;
amt = unit * 15.84;
tax = amt*0.20;
total_amt = amt+tax;
printf("\n Consumed Unit = %d", unit);
printf("\nUnit Bill = Rs. %.2f", amt);
printf("\nTax = Rs. %.2f", tax);
printf("\nElectricity Bill = Rs. %.2f", total_amt);

getch();
}

No comments:

Post a Comment