#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a[10][10],b[10][10],c[10][10];
int i,j,x,n;
printf("\t Enter the no. of row in Matrix ");
scanf("%d",&x);
printf("\n\t Enter the no. of column in Matrix ");
scanf("%d",&n);
printf("\n\t Enter the Matrix of A : ");
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\tThe Matrix is : \n");
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
printf(" %d",a[i][j]);
}
printf("\n");
}
for(i=0;i<x;i++){
for(j=0;j<n;j++) {
b[i][j]= a[j][i];
}
}
printf("\n\tTranspose of Matrix is : \n");
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
printf(" %d",b[i][j]);
}
printf("\n");
}
getch();
}
#include<stdio.h>
void main()
{
clrscr();
int a[10][10],b[10][10],c[10][10];
int i,j,x,n;
printf("\t Enter the no. of row in Matrix ");
scanf("%d",&x);
printf("\n\t Enter the no. of column in Matrix ");
scanf("%d",&n);
printf("\n\t Enter the Matrix of A : ");
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\tThe Matrix is : \n");
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
printf(" %d",a[i][j]);
}
printf("\n");
}
for(i=0;i<x;i++){
for(j=0;j<n;j++) {
b[i][j]= a[j][i];
}
}
printf("\n\tTranspose of Matrix is : \n");
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
printf(" %d",b[i][j]);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment
Please write your doubts