I've done this procedure but the program only asks one time the Input credit card digit group #%d, when I put that it has to do it 4 times. So I guess the problem is the comparison array[i] > 999 && array[i] < 9999
how can I change it so it works?
void demanarDigits(int i, int array[MAX]) {
for (i = 0; i < 4; i++) {
printf("Input credit card digit group #%d: ", i + 1);
scanf("%d", &array[i]);
if (array[i] > 999 && array[i] < 9999) {
i = i + 1;
}
while (array[i] > 9999 || array[i] < 1000) {
printf("ERROR: Digit groups must have 4 digits\n\n");
printf("Input credit card digit group #%d: ", i + 1);
scanf("%d", &array[i]);
if (array[i] > 999 && array[i] < 9999) {
i = i + 1;
}
}
}
}