fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4.  
  5. int m,n;
  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. }
  16. }
  17. printf("printing the array:");
  18. for(int r=0; r<m; r++)
  19. {
  20. for(int c=0; c<n; c++)
  21. {
  22. printf("%d",arr[r][c]);
  23. }
  24. printf("\n");
  25. }
  26. }
  27.  
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
enter row and column number:enter array elements:printing the array: