Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
415 B
1
Indexable
Never
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;
        }
    }
}