Write a program to print any matrix in c
void printMatrice(matrice) {
int x = 0;
int y = 0;
for(x = 0 ; x < numberOfLines ; x++) {
printf(" (");
for(y = 0 ; y < numberOfColumns ; y++){
printf("%d ", matrix[x][y]);
}
printf(")\n");
}
}
4
4
#include <stdio.h>
int main()
{
int i, j, m, n;
int matrix[10][10];
printf("Enter number of rows : ");
scanf("%d", &m);
printf("Enter number of columns : ");
scanf("%d", &n);
for (i = 0; i < m; i++)
{
for (j = 0; j < n; j++)
{
printf("Enter matrix element [%d][%d]: ", i, j);
scanf("%d", &matrix[i][j]);
}
}
for (i = 0; i < m; i++)
{
for (j = 0; j < n; j++)
{
printf("%d\t", matrix[i][j]);
}
printf("\n");
}
}
Thank you!
4
0
Are there any code examples left?
New code examples in category C
-
C 2022-03-27 22:30:45 Problem Statement Print the following output: \ Input Format IN Output Format \
-
-
-
-
-
-
-