Answers for "Write a program to print any matrix in c"

C
0

print matrix 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");
    }
}
Posted by: Guest on May-26-2021
0

Write a program to print any matrix in c

#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");
    }
}
Posted by: Guest on June-25-2021

Code answers related to "Write a program to print any matrix in c"

Code answers related to "C"

Browse Popular Code Answers by Language