articles

Home / DeveloperSection / Articles / Mini Project on Electricity Bill Calculator in C Language

Mini Project on Electricity Bill Calculator in C Language

Vilas Shende35183 08-Oct-2013

In this Article I explain about Mini Project on Electricity Bill Calculation, This Mini Project is developed in C Language. I have used Dev C++ IDE to compile & run this project.

 

1.      Pen IDE, below is snap of IDE I used.

 

Mini Project on Electricity Bill Calculator in C Language


  2.      Go to Menu Bar > file > New > Project

 

Mini Project on Electricity Bill Calculator in C Language

 

 3.      Select Consol Application & give name to your project then press ok button.

 

 Mini Project on Electricity Bill Calculator in C Language

 

4.      Save Your Project on Desktop (You can save anywhere in you machine)

 

Mini Project on Electricity Bill Calculator in C Language

 

Now time to code your Program for Electricity Calculation, Below given Program is helpful for calculation of monthly Electricity Bill's Write below given code  in code window.

#include<stdio.h>


#include<conio.h>



int main()

{

    int units;

    float total_bill;

    printf("\n\nYOU ARE WELLCOME IN ELECTRTICITY BOARD DEPPARTMENT\n.\n");

    printf("ELECTRICITY BOARD RATE CHART (Rates/Unit)\n\n");

    printf("An electricity board charges the following rates to domestic users to discourage large consumption of energy:\n\n");

    printf("0 Unit to 50 Units ..................................=Rs.2.5/Unit\n\n");

    printf("51 Unit to 100 Units .............................. =Rs.3/Unit\n\n");

    printf("101 Unit to 200 Units .............................. =Rs.3.5/Unit\n\n");

    printf("201 Unit to 300 Units .............................. =Rs.4/Unit\n\n");

    printf("301 Unit to 400 Units .............................. =Rs.4.5/Unit\n\n");

    printf("401 Unit to 500 Units .............................. =Rs.4.75/Unit\n\n");

    printf("and more than 500 Uits .............................. =Rs.5/Unit\n");

    printf(".............................................................\n\n");

    printf("\nPlease enter the number of units which has been consumped as per meter\n\n");

    scanf("%d",&units);

    if(units <= 50)

            total_bill = units * 2.5;

    else if(units <= 100)

            total_bill = units * 3;

    else if(units <= 200)

           total_bill = units * 3.5;

     else if(units <= 300)

           total_bill = units * 4;

     else if(units <= 400)

           total_bill = units * 4.5;

     else if(units <= 500)

           total_bill = units * 4.75;

     else

           total_bill = units * 5;

      printf("\n\nthe bill to be paid by you Rs.%f", total_bill);

      getch();

}
  Output: -

Mini Project on Electricity Bill Calculator in C Language

 


Updated 04-Mar-2020
I am a Junior Level Programmer, Software Developer as well as Experienced Virtual Assistant who supports to businesses & individuals with achieving their professional goals.

Leave Comment

Comments

Liked By