adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Program in C to print given matrix using function

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:-



Post a Comment

0 Comments