#include <stdio.h>
void receber_matriz(l, c) {
int M[l][c];
for (l = 0; l < 4 ; l++) {
for (c = 0; c < 4; c++) {
printf("\nInsira o valor do numero da linha: %d e da coluna: %d", l, c);
scanf("%d", &M[l][c]);
}
}
}
int main() {
int l = 0;
int c = 0;
receber_matriz(l, c);
return 0;
}
There is no need for the math library, as it is a simple entry.
I understand that you can use the same function input variable to read from the keyboard in the array.
Variables can be initialized with 0, since they will be entered in the same way. Initialized with 0 would be the logical question because programming is not just writing code. It could even have negative values, but it would not be ideal.
You could even use while for both. It would be less line of code, but it has the detail of: o is when the end is known; the while is for non-countable repeating cases or an unknown end.