Advertisement
sellmmaahh

OR-tut9-zad3_3

Aug 8th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. void IspisiTablearno (int niz[3][3]) {
  5.     int i,j;
  6.     for (i=0; i<3; i++) {
  7.             for (j=0; j<3; j++)
  8.             printf("%3d",niz[i][j]);
  9.     printf("\n");
  10.     }
  11. }
  12.  
  13. void IspisiPokazivacima (int * niz,int m, int n) {
  14.     int i,j;
  15.     for (i=0; i<m; i++)
  16.     {
  17.         int *pok=niz;
  18.         for (j=0; j<m; j++)
  19.             printf("%3d",*pok++);
  20.             printf("\n");
  21.             niz++;
  22.     }
  23. }
  24.  
  25. int main () {
  26.     int mat[3][3]={1,2,3,4,5,6,7,8,9};
  27.     printf("Matrica: \n");
  28.     IspisiTablearno(mat);
  29.     printf("\nSa pokazivacima: \n");
  30.     IspisiPokazivacima(mat,3,3);
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement