-
Notifications
You must be signed in to change notification settings - Fork 0
/
Electricity bill.c
47 lines (36 loc) · 1.07 KB
/
Electricity bill.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
#include<stdio.h>
int main()
{
int CU,UP;
float VAT,Bill;
printf("Enter the value of consumption unit: ");
scanf("%d",&CU);
printf("Enter the value of unit Price: ");
scanf("%d",&UP);
if((CU>200)&&(UP>5))
{
VAT = (CU*UP)*0.1;
Bill = (CU*UP)+VAT;
printf("\nTotal Bill = %f\n\n",Bill);
}
else if((CU>400 && CU<600)&&(UP>10))
{
VAT = (CU*UP)*0.1;
Bill = (CU*UP)+VAT;
printf("\nTotal Bill = %f\n\n",Bill);
}
else if((CU>=600)&&(UP>15))
{
VAT = (CU*UP)*0.1;
Bill = (CU*UP)+VAT;
printf("\nTotal Bill = %f\n\n",Bill);
}
else
printf("\nInvalid\n\n");
return 0;
}
--------------------------------------------------------
output--
Enter the value of consumption unit: 300
Enter the value of unit Price: 10
Total Bill = 3300.000000