I've tried the following code:
scanf("%d %d",&N,&M);
int matrix[N][M];
for(int i=0;i<N;i++){
for(int j=0;j<M;M++){
scanf("%d",&matrix[i][j]);
}
}
but when executing it does not stop asking for data, the program does not advance.