ShriRam Changed status to publish July 15, 2022
#include<stdio.h> void main() { float purchase,discount,bill; printf("Enter Purchase Amount: Rs"); scanf("%f",&purchase); printf("\n"); if(purchase>=10000) { discount = (purchase*10)/100; bill = purchase-discount; printf("After applying the discount, you have to pay: Rs.%0.2f", bill); } else if(purchase<10000 && purchase>=5000) { discount = (purchase*5)/100; bill = purchase-discount; printf("After applying the discount, you have to pay: Rs.%0.2f", bill); } else if (purchase<5000) { discount = (purchase*2)/100; bill = purchase-discount; printf("After applying the discount, you have to pay: Rs.%0.2f", bill); } getch(); }
ShriRam Changed status to publish July 15, 2022