Computer Science, asked by lekshmi81, 1 year ago

please send me the c program​

Attachments:

lekshmi81: hi
Anonymous: hi
lekshmi81: wap to read and print m*n matrix , please send me the c program
lekshmi81: answer pls
Anonymous: I did answer. Plz mark it as brainist
lekshmi81: okay
Anonymous: Plz hit that thanks button :)
lekshmi81: welcome
Anonymous: c'mon i didnt say thanks. I told you to press the "Thanks" button.

Answers

Answered by Anonymous
0

#include <stdio.h>

 

#define MAXROW      10

#define MAXCOL      10

 

int main()

{

   int matrix[MAXROW][MAXCOL];

   int i,j,r,c;

     

   printf("Enter number of Rows :");

   scanf("%d",&r);

   printf("Enter number of Cols :");

   scanf("%d",&c);

 

   printf("\nEnter matrix elements :\n");

   for(i=0;i< r;i++)

   {

       for(j=0;j< c;j++)

       {

           printf("Enter element [%d,%d] : ",i+1,j+1);

           scanf("%d",&matrix[i][j]);

       }

   }

 

   printf("\nMatrix is :\n");

   for(i=0;i< r;i++)

   {

       for(j=0;j< c;j++)

       {

           printf("%d\t",matrix[i][j]);

       }

       printf("\n");   /*new line after row elements*/

   }

   return 0;    

}

Hope it helps :)

Similar questions