Monday 17 September 2012

Calculate sales tax


Your program should guide the user to accept price of item and result with adding  sales tax.
/*C program for calculate sales tax*/
#include<stdio.h>
#include<conio.h>
#define S_TAX 0.5
int main()
{
 float price,tot_cost;
 printf("Enter price of item : ");
 scanf("%f", &price);
 tot_cost=price+(price*S_TAX);
 printf("Total cost(with Sales Tax)= %f",tot_cost);
 getch();
 return 0;
}

No comments:

Post a Comment