The first problem of this code:
for (int i =0 ; i<= m-1 ; i++)
{
for (int j=0 ; j<= n -1 ; j++)
{
c=twod[j][i] ;
twod[j][i] = twod[i][j] ;
twod[i][j] = c ;
}
}
is that it transpose each element 2 times. You need to change the loops to scan only a half of the matrix (triangle) the swap is doing the other half.
Secondary problem, your code do not handled non square matrix.
You don't need to transpose the matrix to simply print it in transposed form.