Untitled

 avatar
unknown
plain_text
3 years ago
415 B
5
Indexable
void print_promotions(groceries_list list[], int store) {
    int i, j = 0;


    for (i = 0; i < MAX; i++) {
        if (strcmp(user_groceries[j], list[store].name[i]) == 0) {
            j++;
                if (list[store].onSale[i] == 1) {
                    printf("%s is on sale for %.2lf DKK!\n", list[store].name[i], list[store].cost[i]);
                }
            i = 0;
        }
    }
}
Editor is loading...