Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
426 B
0
Indexable
Never
#include <stdio.h>
void main()
{
   int i,j;
   int r,c;

   printf("Enter the number of rows and column: \n");
   scanf("%d%d",&r,&c);
int num[r][c];
   printf("Enter the %d elements of matrix: \n",r*c);

   for(i=0;i<r;i++){
    for(j=0;j<c;j++){

        scanf("%d",&num[i][j]);
    }
   }
   for(i=0;i<r;i++){
    for(j=0;j<c;j++){

        printf("%d\t",num[i][j]);
    }
printf("\n");
   }
   }
Leave a Comment