Untitled
unknown
plain_text
2 years ago
426 B
3
Indexable
#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");
}
}
Editor is loading...
Leave a Comment