problem in Program to find Transpose of Given Square Matrix
hi .I want to find transpos of square matrix.but my program does not run complete.I think there is some problem.can you help me?:frown::frown:
Code:
#include<iostream>
using namespace std;
const int size=3;
void read(int a[size][size])
{
cout<<"enter"<<size*size<<numbers<<endl; for(int i=0;i<size;i++){
cout<< "row"<<i<<":";
for(int j=0;j<size;j++)
cin>>a[i][j];
}}
void trans(int at[size][size],int a[size][size])
{
int i,j;
for(int i=0;i<size;i++){
for(int j=0;j<size;j++)
at[i][j]=a[j][i];
cout<<at[i][j];
cout<<endl;
}}
int main()
{
int a[3][3],at[3][3];
read(a);
trans(a,at);
trans(a,at);
return 0;
}