P023.c (622B)
1 /* WAP to input the total cost and compute the amount to be paid 2 by the customer. */ 3 // This code has not been compiled. 4 // If you find any issues, please create a new issue on GitHub regarding them. 5 6 #include <stdio.h> 7 int main() 8 { 9 double cost, amt; 10 printf("Enter the total cost : "); 11 scanf("%lf", &cost); 12 if (cost <= 2000) 13 amt = cost * 0.94; 14 else if (cost > 2000 && cost <= 5000) 15 amt = cost * 0.9; 16 else if (cost > 5000 && cost <= 10000) 17 amt = cost * 0.85; 18 else if (cost > 10000) 19 amt = cost * 0.8; 20 printf("\nAmount to be paid : %g", amt); 21 return 0; 22 }