Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. void cargar(int mat[3][5])
  5. {
  6.     int f,c;
  7.     f=0;
  8.     while(f<3)
  9.     {
  10.         c=0;
  11.         while(c<5)
  12.         {
  13.             printf("Ingrese componente:");
  14.             scanf("%i",&mat[f][c]);
  15.             c=c+1;
  16.         }
  17.         f=f+1;
  18.     }
  19. }
  20.  
  21. void imprimir(int mat[3][5])
  22. {
  23.     int f,c;
  24.     f=0;
  25.     while(f<3)
  26.     {
  27.         c=0;
  28.         while(c<5)
  29.         {
  30.             printf("%i ",mat[f][c]);
  31.             c=c+1;
  32.         }
  33.         printf("\n");
  34.         f=f+1;
  35.     }
  36. }
  37.  
  38.  
  39. int main()
  40. {
  41.     int mat[3][5];
  42.     cargar(mat);
  43.     imprimir(mat);
  44.     system("pause");
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement