-
Notifications
You must be signed in to change notification settings - Fork 0
/
TAreq.c
62 lines (62 loc) · 1.29 KB
/
TAreq.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include<stdio.h>
void main ()
{
char category,type;
int unit;
float bill, totalbill;
printf("Enter Category: n\A. Residential\nB. Agricultural Pumping:\nC. Industrial Area\n");
scanf("%c",&category);
printf("Consumed Unit: \n");
scanf("%d",&unit);
if(category=='A')
{
printf("Residential Area\n");
if(unit>=0 && unit<=75)
{
bill=unit*3.80;
}
else if(unit>=76 && unit<=200)
{
bill=unit*5.36;
}
else if(unit>=301 && unit<=400)
{
bill=unit*5.63;
}
else if(unit>=401 && unit<=600)
{
bill=unit*8.70;
}
else if(unit>=601)
{
bill=unit*9.98;
}
else
{
printf("Invalid");
}
totalbill=bill+bill*0.2;
}
else if(category=='B')
{
printf("Industrial Area\nEnter Type\nA.Flat Rate\nB.Off Peak Rate");
scanf("%c",&type);
if(type =='A')
{
totalbill=unit*7.66;
}
else if(type =='B')
{
totalbill=unit*9.24;
}
else
{
printf("Invalid");
}
}
else
{
printf("Invalid");
}
printf("Electricity Bill = f",totalbill);
}