fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4.  
  5. int m,n,sum=0;
  6. printf("enter row and column number:");
  7. scanf("%d %d",&m,&n);
  8. int arr[m][n];
  9. printf("enter array elements:");
  10. for(int r=0; r<m; r++)
  11. {
  12. for(int c=0; c<n; c++)
  13. {
  14. scanf("%d",&arr[r][c]);
  15. sum=sum+arr[r][c];
  16. }
  17. }
  18.  
  19.  
  20.  
  21.  
  22. printf("%d",sum);
  23. }
  24.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
enter row and column number:enter array elements:0