Passing 2-D without passing row size & column size

Passing 2-D without passing row size & column size


Output:


123
456


Implementation:



#include <stdio.h>
#include <stdlib.h>
void printarray(int a[][3],int r,int c)
{
 int i,j;
 for(i=0;i<r;i++)
 {
  for(j=0;j<c;j++)
  {
   printf("%d",a[i][j]);
  }
  printf("\n");
 }
}
int main(void) {
 int a[2][3]={{1,2,3},{4,5,6}};
 printarray(a,2,3);
 return 0;
}