Question: Write the Code in C Write a structure Product with the following attributes: pName(string), quantity(integer), cost-price(float), selling-price(float). Now answer the following questions: (a) Create an
Write the Code in C

Write a structure Product with the following attributes: pName(string), quantity(integer), cost-price(float), selling-price(float). Now answer the following questions: (a) Create an array of structure of arbitrary size and populate the array. All the information must be user inputs. (b) Write a function that will take name and array of structure as parameter and return the total profit that the shop will incur from that product. Here, total profit= quantity X (selling-price - cost_price). (c) Write a function that takes the structure array as input and returns a structure variable best Product that contains the product that incurs the most profit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
