Update Q2.c

This commit is contained in:
2024-11-18 20:46:54 -08:00
parent e93dfac07a
commit f1b37bca68

9
Q2.c
View File

@@ -43,14 +43,15 @@ Product* insert_product(Product *head, int id, char *name, int quantity) {
return head;
}
void print_all_products(Product *head) {
void print_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);
printf("Product id: %d\n", temp->id);
printf("Name: %s\n", temp->name);
printf("Quantity: %d\n\n", temp->quantity);
temp = temp->next;
}
printf("\n");
}
int main() {