Page

Wednesday, 19 September 2018

program for printing matrix in c

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a[100][100],n,m,i,j;
printf("enter the number of rows:");
scanf("%d",&n);
printf("enter the number of column:");
scanf("%d",&m);
printf("Enter the number of matrix:\n");
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nMatrix is:\n");
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n");
}
getch();
}





                                                                  created by LUV YADAV

No comments:

Post a Comment