#include<stdio.h>
#define M 6
#define N 5
int main(){
int array[N][M];
int i, j;
for(i=0;i<N;i++){
for(j=0;j<M;j++){
scanf("%d", &array[i][j]);
if(array[0][1]<1 || array[0][2]<1 || array[0][3]<1){
// ??
}
}
}
return 0;
}
How do I make it so that if the input doesn't match my (very likely wrong) if statement, the
user must reinput that array field and it doesnt just skip to the next input field?
To solve this you can simple do the following. If input is wrong, decrement j by 1 to force the user to reinput the same field. It may also make sense to tell the user that their input was wrong, so they know to enter the proper value.