C program to Calculate Electricity Bill

In this tutorial you will learn about the C program to Calculate Electricity Bill and its application with practical example.

C program to Calculate Electricity Bill

In this tutorial, we will learn to create a C program that will calculate the Electricity Bill in C programming.

Prerequisites

Before starting this tutorial, we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C Programming.
  • Arithmetic Operators in C Programming.

What is an Electricity Bill?

The electricity bill is the generated net payable amount charged by the electricity-providing company. The electricity bill is generated on the basis of the consumption of the electricity in units by the consumer.

Algorithm:-

Program Description.

In this program, First will take the input units from the user. Secondly, we will use the conditional statements to generate the electricity bill of the user. At last, we will print the electricity bill of the user.

With the help of the below program, we can calculate the electricity bill.

Program Code:-

Output:-

In the above program, we have first initialized the required variable.

  • bill = it will hold the float value for the bill
  • units = it will hold the input float value for the units.

Taking the input units from the user.

Calculating the Bill of the user.

Printing the output bill.

In this tutorial we have learn about the C program to Calculate Electricity Bill and its application with practical example. I hope you will like this tutorial.