-1
Write a program that reads an array (maximum 10 x 10). The order matrix is chosen by the user. Next use a function to:
a) Read integer values from matrix;
b) Show matrix values;
However, it is giving error, the matrix is not being assembled, or is generating random numbers...
#include <stdio.h>
int ler(int l, int c,int matriz[10][10]){
printf("Digite a quantidade de linhas da matriz:");
scanf("%d", &l);
printf("Digite a quantidade de colunas da matriz:");
scanf("%d", &c);
int l2 = l;
int c2 = c;
for(l = 0; l < l2; l++){
for(c = 0; c < c2; c++){
printf("Linha = [%d] Coluna = [%d] = ", l, c);
scanf("%d", &matriz[l][c]);
}
}
}
int escrever(int *l, int *c, int matriz[*l][*c]){
int l3, c3;
l3 = *l;
c3 = *c;
printf("Matriz:\n");
for(*l = 0; *l < l3; *l++){
for(*c = 0; *c < c3; *c++){
printf("%d \t", matriz[*l][*c]);
}
printf("\n");
}
printf("\n");
}
int main(){
int matriz[10][10], l, c;
ler(l, c, matriz);
escrever(&l, &c, matriz);
}