#include
#include
void main()
{
int nm[100],i=0,j,k,key,a=0;
clrscr();
printf("Enter data:\n");
while(a!=-1)
{
scanf("%d",&a);
nm[i]=a;
i++;
}
for(j=1;j=0&&nm[k]>key)
{
nm[k+1]=nm[k];
k--;
}
nm[k+1]=key;
}
printf("The sorted list is=");
for(j=0;j
printf("%d ",nm[j]);
getch();
}
0 comments:
Post a Comment