Write a C program to calculate total electricity bill switch statement

Last modified on December 24th, 2019 Download This Tutorial in PDF

Write a C program to input electricity unit charges and calculate total electricity bill by using the switch statement according to the given condition:
For the first 50 units Rs. 0.50/unit
For the next 100 units Rs. 0.75/unit
For the next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill.

Flowchart of the program to calculate the total electricity bill by using the switch statement

Flowchart of the program to calculate the total electricity bill by using the switch statement

C++ Source Code to calculate the total electricity bill switch statement

Output

enter the number of units you consumed

100

your total bill is Rs 75

SFT (Shamil’s Flow Table )

Are you interested to Read about SFT(Shamil’s Flow Table)?

Explanation of the logic to calculate the total electricity bill switch statement

Subscribe for Friendship

Latest posts by Prof. Fazal Rehman Shamil (see all)