#include<stdio.h>
void main()
{
int a[10][10],r,c,i,j;
printf("Enter the no. of rows and columns of array:");
scanf("%d%d",&r,&c);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("Enter a[%d][%d]:",i,j);
scanf("%d",&a[i][j]);
}
}
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n");
}
printf("\n\n");
for(i=0;i<c;i++)
{
for(j=0;j<r;j++)
{
printf("\t%d",a[j][i]);
}
printf("\n");
}
getch();
}
void main()
{
int a[10][10],r,c,i,j;
printf("Enter the no. of rows and columns of array:");
scanf("%d%d",&r,&c);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("Enter a[%d][%d]:",i,j);
scanf("%d",&a[i][j]);
}
}
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n");
}
printf("\n\n");
for(i=0;i<c;i++)
{
for(j=0;j<r;j++)
{
printf("\t%d",a[j][i]);
}
printf("\n");
}
getch();
}