C programming

Saturday, January 17, 2009

#include #include void main() { int a[50],i,j,temp,smin,n; clrscr(); printf("How many number you want to enter:"); scanf("%d",&n); for(i=0;i { printf("Element[%d]=",i+1); scanf("%d",&a[i]); } for(i=0;i { smin=i; for(j=i+1;j { if(a[j] smin=j; } temp=a[i]; a[i]=a[smin]; a[smin]=temp; } printf("the sorted list is:\n"); for(i=0;i { printf("%d ",a[i]); } getch(); }

0 comments:

Visitors

PlugIn.ws - Free Hit Counter, Web Site Statistics, Traffic Analysis

  © Blogger template Leaving by Ourblogtemplates.com 2008

Back to TOP