/* write a function total_price(double price[], int num_items) has two parameters array of doubles (prices) and number of items (integer) the function reads prices and finds new price for each item prints it and finds and returns total price using the following discount rules: if the price <=10 - 5% discount if the price >10 and price<=20 10%discount 15% discount for all items price>20 write a program that reads a number of items user purchased in the store, num_items test function total_price */ #include #define SIZE 10000 double total_price(double price[], int num_items); //function prototype int main(){ double price[SIZE]; int i,num_items; printf("enter number of items\n"); scanf("%d",&num_items); if(num_items>0 && (num_items<=SIZE)){ printf("enter %d prices\n", num_items); for(i=0;i10 && price[i]<=20) new_price=price[i]*0.9; else new_price=price[i]*0.85; printf("new price %.2f\n",new_price); sum+=new_price; } return sum; }