/* write a program that reads a number of items user purchased in the store, num_items then the program reads num_items prices (integers) and then the program finds the 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 use array to store prices the program should print random array and an updated price for each item (float or double) and the total price after discount */ #include #include #include #define SIZE 10000 int main(){ int price[SIZE], i,num_items; double new_price, sum=0.0; printf("enter number of items\n"); scanf("%d",&num_items); if(num_items>0 && (num_items<=SIZE)){ printf("prices are\n"); for(i=0;i10 && price[i]<=20) new_price=price[i]*0.9; else new_price=price[i]*0.85; printf("new price %f\n",new_price); sum+=new_price; } printf("total price is %f\n",sum); } else printf("invalid input\n"); return 0; }