Answer:
Check the explanation
Explanation:
#include <stdio.h>
void CalculateTotal(float cost,int quantity,int tax){
float costbeforetax=cost*quantity;
printf("\nTotal Cost Before Tax %f is ",costbeforetax);
float taxamount=(costbeforetax*tax)/100;
printf("\n Tax amount %f is ",taxamount);
float total=costbeforetax+taxamount;
printf("\n Total amount after Adding Tax %f is ",total);
}
int main()
{
float cost;
int quantity,tax;
printf("Enter Cost of Item ::");
scanf("%f",&cost);
printf("Enter Quantity of Item ::");
scanf("%d",&quantity);
printf("Enter Tax in % ::");
scanf("%d",&tax);
CalculateTotal(cost,quantity,tax);
return 0;
}
/*
The Output will look like this:
Enter Cost of Item ::10
Enter Quantity of Item ::5
Enter Tax in % ::23
Total Cost Before Tax 50.000000 is
Tax amount 11.500000 is
Total amount after Adding Tax 61.500000 is
*/