See Plus Plus,
Ah, sorry . Just change the way you print the result. That will get you the o/p you want. Any. here is the changed program for the second one..
#include <stdio.h>
int main(void)
{
int b[5][4],i,j,temp[5][4],k;
int a[5][4]={3,33,333,3333,5,55,555,5555,1,11,111,1111
,4,44,444,4444,2,22,222,2222};
for(k=0;k<4;k++)
{
for(i=0;i<5;i++)
{
for(j=0;j<4;j++)
{
if(a[i][k]>a[j][k])
{
temp[i][k]=a[i][k];
a[i][k]=a[j][k];
a[j][k]=temp[i][k];
}
}
}
}
printf("\n");
for(i=4;i>=0;i--)
{
for(j=3;j>=0;j--)
{
printf("%d",a[i][j]);
printf(" ");
}
printf("\n");
}
}