/*
* 1000+ C programs + tutorials
*
*
* 36_calculate_discount_amount.c
*
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include
//#include
void main() {
float price;
float discount_percentage;
float discount_amount;
float discounted_price;
// clrscr();
printf("C Program to Calculate Discount Amount : ");
printf("\n\n Enter Price of Item : ");
scanf("%f", &price);
printf("\n\n Enter Discount Percentage on Item : ");
scanf("%f", &discount_percentage);
discount_amount = (discount_percentage*price)/100;
discounted_price = (price-discount_amount);
printf("\n\nDiscount amount : %f \n\n", discount_amount);
printf("Discounted price : %f \n\n", discounted_price);
// getch();
}
-
Output :
C Program to Calculate Discount Amount :
Enter Price of Item : 100
Enter Discount Percentage on Item : 10
Discount amount : 10.00
Discounted price : 90.00
The best way to learn C programming is to practice more and more of programs .
Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.
BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.