First, use "paste as text" when you paste code, then it looks like this
Code:
j = 0;
k = 0;
coinCount = 2; // previously prompted
for (i = 0; i < coinCount; i++) {
printf("\nYear: ");
coin[j][k] = check(a); //A function that validates the input
k++;
printf("\nCondition: ");
coin[j][k] = check(a);
j++;
}
j = 0;
k = 0;
// For every coin, check if condition is 1.
for (i = 0; i < coinCount; i++) {
if (coin[j][1] == 1) {
mint = mint + (3 * coin[j][0]); // THIS doesn't work.
j++;
}
}
Next, look at your loop variables.
Code:
for (i = 0; i < coinCount; i++) {
if (coin[j][1] == 1) {
mint = mint + (3 * coin[j][0]); // THIS doesn't work.
j++;
}
}
You don't need j at all.
In fact, in all the code, you may as well stick with coin[i][0] and coin[i][1]