Advertisement
luizaspan

Inicialização aleatória matriz

Jun 23rd, 2015
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define n 10
  5. #define m 15
  6.  
  7. int main(void)
  8. {
  9.     int i,j,M[m][n];
  10.  
  11.     for (i=0;i<n;i++)
  12.     {
  13.         for (j=0;j<m;j++)
  14.         {
  15.             M[i][j]=rand() % (n*m); // quantidade de caracteres
  16.             printf("%d ",M[i][j]);
  17.         }
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement