Write a C Program to display the following matrix
#include <stdio.h>
int main()
{
int row, column;
int matrix[10][20];
printf("Enter number of rows : ");
scanf("%d", &row);
printf("Enter number of columns : ");
scanf("%d", &column);
for (int i = 0; i < row; i++)
{
for (int j = 0; j < column; j++)
{
printf("Enter data in [%d][%d]: ", i, j);
scanf("%d", &matrix[i][j]);
}
}
for (int i = 0; i < row; i++)
{
for (int j = 0; j < column; j++)
{
printf("%d\t", matrix[i][j]);
}
printf("\n");
}
return 0;
}
Comments
Leave a comment