Update Q2.c
This commit is contained in:
10
Q2.c
10
Q2.c
@@ -43,7 +43,15 @@ Product* insert_product(Product *head, int id, char *name, int quantity) {
|
|||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
//void print_products
|
void print_all_products(Product *head) {
|
||||||
|
Product *temp = head;
|
||||||
|
while(temp != NULL) {
|
||||||
|
printf("Product ID: %d\n", temp->id);
|
||||||
|
printf("Product Name: %s\n", temp->name);
|
||||||
|
printf("Product Quantity: %d\n\n", temp->quantity);
|
||||||
|
temp = temp->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user