fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i,j;
  5. int a[3][4]={{1,1,2,1},{2,2,1,3},{4,3,2,1}};
  6. int b[3][4]={{2,3,5,2},{3,1,6,1},{1,1,5,0}};
  7. int c[3][4];
  8.  
  9. for(i=0;i<3;i++)
  10. for(j=0;j<4;j++)//notice "j++"
  11. c[i][j]=a[i][j]+b[i][j];
  12. for(i=0;i<=2;i++)
  13. {
  14. for(j=0;j<=3;j++)
  15. printf(" %d",a[i][j]);//notice "a[i][j]"
  16. printf("\n");
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
	1	1	2	1
	2	2	1	3
	4	3	2	1