FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 29   



Following program shows you how to calculate discount.
In this program we get bill amount and discount from user and shows after discount amount using following formula
Discount = bill - (bill * discount / 100)

#include <stdio.h>

int main(void) {
    int bill;
    int discount;

    printf("Enter bill amount:");
    scanf("%d", &bill);

    printf("Enter discount percentage:");
    scanf("%d", &discount);

    int afterDiscount = bill - (bill * discount / 100);

    printf("After discount your bill is: %d", afterDiscount);
}

Output:

Enter bill amount: 20000
Enter discount percentage: 10
After discount your bill is: 18000



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News