in c language program, write a code that display the information of all products o display the names and price per unit for all products in the linked list with the quantity less than two calculate...


in c language program, write a code that



  • display the information of all products

  • o display the names and price per unit for all
    products in the linked list with the quantity less than two

  • calculate the total price of all products in the


all of the code is in different function or segemnt


#include <stdio.h><br>#include <stdlib.h><br>#inkcude <string.h><br>#define MAX_NUM 5<br>int main () {<br>struct Product{<br>char name [20];<br>int quantity:<br>double unitPrice; //price per unit<br>//product name<br>// quantity<br>};<br>typedef struct Product Product;<br>struct Node (<br>Product myProduct;<br>Struct Node *next;<br>};<br>typedef struct Node Node;<br>Node *front = NULL, *ptrl;<br>char inputName [20];<br>int inputQuantity;<br>double inputUnitPrice;<br>int i;<br>for (i=1; i<MAX_NUM; i++)<br>printf (myProduct.name, inputName) ; ptrl->myProduct.quantity = inputQuantity; ptrl->myProduct.unitPrice = inputUnitPrice; ptrl->next = NULL; if (front != NULL) ptrl->next = front; front = ptrl; return 0; "/>
Extracted text: #include #include #inkcude #define MAX_NUM 5 int main () { struct Product{ char name [20]; int quantity: double unitPrice; //price per unit //product name // quantity }; typedef struct Product Product; struct Node ( Product myProduct; Struct Node *next; }; typedef struct Node Node; Node *front = NULL, *ptrl; char inputName [20]; int inputQuantity; double inputUnitPrice; int i; for (i=1; imyProduct.name, inputName) ; ptrl->myProduct.quantity = inputQuantity; ptrl->myProduct.unitPrice = inputUnitPrice; ptrl->next = NULL; if (front != NULL) ptrl->next = front; front = ptrl; return 0;

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here