Can we traverse vertically if so how

can we traverse vertically if so how

for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
cout<<a[j][i];
}
}