A variety of 15 percent of discount on sales of totaling $300 or more. Write the program by using functions in c programming that request the cost of 3 items and print the amount the coustmer must have to pay.
#include <stdio.h>
double getFinalCost(double cost){
if(cost >= 300){
cost = (cost*75)/100;
}
return cost;
}
int main(){
double cost, total = 0;
printf("Enter first item cost: ");
scanf("%lf",&cost);
total += cost;
printf("Enter second item cost: ");
scanf("%lf",&cost);
total += cost;
printf("Enter third item cost: ");
scanf("%lf",&cost);
total += cost;
printf("coustmer must have to pay: %lf\n",getFinalCost(total));
return 0;
}


A variety of 15 percent of discount on sales of totaling $300 or more. Write the...