Share this topic on FacebookShare this topic on MySpaceShare this topic on Del.icio.usShare this topic on DiggShare this topic on RedditShare this topic on StumbleUponShare this topic on TwitterShare this topic on TechnoratiShare this topic on MagnoliaShare this topic on GoogleShare this topic on Yahoo

Author Topic: ascending order program  (Read 310 times)

Offline jayanthi mandhalapu

  • Acumen
  • Hero Member
  • ***
  • Posts: 4985
  • Acumen
    • View Profile
ascending order program
« on: August 06, 2009, 09:16:40 PM »
the main concept of the program

for(i=0;i<n;i++)
scanf("%d",&x);
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if(x>x[j])
{
temp=x;
x=x[j];
x[j]=temp;
}
printf("ascending order of given no");
for(i=0;i<n;i++)
printf("%5d",x);
Be Happy And Always Remain So