ExercMatrizes3

De IFSC
Revisão de 10h28min de 22 de outubro de 2019 por imported>Fargoud (Criou página com ' #include <stdio.h> #include <stdlib.h> #define NLINHAS 2 #define NCOLUNAS 3 int main() { int i, j, Mat[NLINHAS][NCOLUNAS]; printf("PROGRAMA DA MATRIZ TRANSPOSTA\...')
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para navegação Ir para pesquisar
#include <stdio.h>
#include <stdlib.h>

#define NLINHAS 2
#define NCOLUNAS 3
int main()
{   int i, j, Mat[NLINHAS][NCOLUNAS];
   printf("PROGRAMA DA MATRIZ TRANSPOSTA\n");
   for(i=0;i<NLINHAS;i++) //conta as linhas
       for(j=0;j<NCOLUNAS;j++)//conta as colunas
      { printf("\nEntre com o elemento [%d,%d]:", i+1,j+1 );
        scanf("%d", &Mat[i][j]);
      }

   printf("\nA matriz transposta \202:\n\n");
   for(i=0;i<NCOLUNAS;i++) //conta as linhas
  {   printf("|  ");
      for(j=0;j<NLINHAS;j++)//conta as colunas
        printf(" %3d ", Mat[j][i] );
      printf("   |\n");
  }
   return 0;
}