Professional Documents
Culture Documents
Lab-3 - POP Using C
Lab-3 - POP Using C
3. An electricity board charges the following rates for the use of electricity: for the first 200
units 80 paise per unit: for the next 100 units 90 paise per unit: beyond 300 units Rs 1 per unit. All
users are charged a minimum of Rs. 100 as meter charge. If the total amount is more than Rs 400,
then an additional surcharge of 15% of the total amount is charged. Write a program to read the
name of the user, the number of units consumed, and print out the charges.
Algorithm:
Step 1: START
Step 2 : Read the name of the user
Step 3: Read the number of units consumed
Step 4: Initialize the minimum meter charge as 100
Step 5: if(unit <= 200) then
Flowchart:
Program:
#include <stdio.h>
void main()
{
char name[10];
scanf("%s", name);
printf("Enter electricity units consumed:");
scanf("%f", &unit);
Dept. of AI & DS, SMVITM, Bantakal Page 2
BPOPS103/203 Principles of Programming using C Lab
Output:
Case 1:
Name: Keerthi
MeterCharge: 260.000
Case 2:
Name: Anika
Number of unit consumed: 400 MeterCharge : 517.50