Just tried it with char (i,j) too, but it does the same thing, my output is all right.
Maybe you need to add char to both the counter usage parts, like ISO C++ demands?
Like this:
Code:
//TO TRANSPOSE A MXN MATRIX.//
#include<iostream>
#include<iomanip>
using namespace std;
main()
{
int a[3][4];
cout<<"ENTER THE ELEMENTS OF ARRAY : ";
for(char i=0;i<3;++i)
{
for(char j=0;j<4;++j)
cin>>a[i][j];
}
for(char i=0;i<4;++i)
{
for(char j=0;j<3;++j)
cout<<setw(3)<<a[j][i]<<" ";
cout<<endl;
}
}