Update Q2.c

This commit is contained in:
2024-11-05 09:40:59 -08:00
parent 322081b764
commit e93dfac07a

10
Q2.c
View File

@@ -43,7 +43,15 @@ Product* insert_product(Product *head, int id, char *name, int quantity) {
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() {