fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(void)
  5. {
  6. int arr[4][4];
  7. int arr1[4][4];
  8. int arr2[4][4];
  9. int arr3[4][4];
  10. int i,j;
  11. int k = 1;
  12.  
  13.  
  14. for(i=0; i<4; i++)
  15. for(j=0; j<4; j++)
  16. arr[i][j] = k++;
  17.  
  18. for(j=0; j<4; j++)
  19. arr1[j][3] = arr[0][j];
  20. arr1[j][2] = arr[1][j];
  21. arr1[j][1] = arr[2][j];
  22. arr1[j][0] = arr[3][j];
  23.  
  24.  
  25. for(i=0; i<4; i++)
  26. {
  27. for(j=0; j<4; j++)
  28. printf("%4d",arr[i][j]);
  29. printf("\n");
  30. }
  31.  
  32. for(i=0; i<4; i++)
  33. {
  34. for(j=0; j<4; j++)
  35. printf("%4d",arr1[i][j]);
  36. printf("\n");
  37. }
  38. }
  39.  
Runtime error #stdin #stdout 0s 1832KB
stdin
Standard input is empty
stdout
   1   2   3   4
   5   6   7   8
   9  10  11  12
  13  14  15  16
-1217724345-1218382347  47   1
   0-1077936688-1217159968   2
-1216903792134518744-1077936776   3
   1-1077936604-1077936596   4