#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:
Post a Comment