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