0
I wonder if you have how to print these three matrices without having to create several for's
, the printing of the same on the screen should be separated. ( I need an alternative because I have little space and the code was very extensive when I was printed in the conventional way )
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
int main () { setlocale(LC_ALL,"Portuguese");
int mat1[100][100], mat2[100][100], mat3[100][100], linha = 0, coluna = 0;
// red, blue, green
printf("\nInforme o número de linhas e colunas: ");
scanf("%i %i",&linha,&coluna);
for ( int i = 0; i < linha; i++){
for ( int h = 0; h < coluna; h++){
printf("\nInforme um digito para linha %i, coluna %i matriz red: ",i, h);
scanf("%i",&mat1[i][h]);
}
system("cls");
for ( int j = 0; j < coluna; j++){
printf("\nInforme um digito para linha %i, coluna %i matriz blue: ",i, j);
scanf("%i",&mat2[i][j]);
}
system("cls");
for ( int q = 0; q < coluna; q++){
printf("\nInforme um digito para linha %i, coluna %i matriz green: ",i,q);
scanf("%i",&mat3[i][q]);
}
system("cls");
}
// imprimir toda a primeira, depois a segunda e por fim a terceira...
return 0;
}