Program in C to print given matrix using function
#include<stdio.h> #include<conio.h> void show(int p[][3],int r,int c) { int i,j; for(i=0;i<r;i++) { for(j=0;j<c;j++) printf("%3d",p[i][j]); printf("\n"); } } int main() { int m[3][3],i,j; printf("Enter a matrix of size 3 * 3::-\n"); for(i=0;i<3;i++) { for(j=0;j<3;j++) scanf("%d",&m[i][j]); } printf("Entered marix is given below:\n"); show(m,3,3); getch(); }Output:-
0 Comments