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