Write a c program to accept nXn matrix from user and display the elements of given matrix using function

#include<stdio.h>
#include<conio.h>
void main()
{
void mat(int,int);
int r,c;
clrscr();
printf("\n enter the limit row \n");
scanf("%d",&r);
printf("\n enter the coloum col \n");
scanf("%d",&c);
mat(r,c);
getch();
}
void mat (int r,int c)
{
int a[10][20];
int i=0,j=0;
printf("\n enter the matrix element \n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n the enter matrix is\n\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n");
}
}


Comments