Learn C ProgrammingLearn ProgrammingPrograms On ArraysResources

073. Write a program to accept a mXn matrix and reprint it in matrix form in C language

By September 18, 2012 September 18th, 2019 No Comments
#include<stdio.h>
#include<conio.h>  
main()
{
	int i,j,m,n,a[5][5];
	clrscr();
	printf("Enter order of matrix :\n");
        scanf("%d%d",&m,&n);
	printf("Enter matrix elements.....\n");
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
			scanf("%d",&a[i][j]);
 
	for(i=0;i<m;i++)
	{
		for(j=0;j<n;j++)
			printf("%d ",a[i][j]);
		printf("\n");
	}
	getch();
}

Leave a Reply

DEMO01