P023.c (758B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* WAP to input the total cost and compute the amount to be paid 8 by the customer. */ 9 // This code has not been compiled. 10 // If you find any issues, please create a new issue on GitHub regarding them. 11 12 #include <stdio.h> 13 int main() 14 { 15 double cost, amt; 16 printf("Enter the total cost : "); 17 scanf("%lf", &cost); 18 if (cost <= 2000) 19 amt = cost * 0.94; 20 else if (cost > 2000 && cost <= 5000) 21 amt = cost * 0.9; 22 else if (cost > 5000 && cost <= 10000) 23 amt = cost * 0.85; 24 else if (cost > 10000) 25 amt = cost * 0.8; 26 printf("\nAmount to be paid : %g", amt); 27 return 0; 28 }