Feed Headline Animator

Bubble sort

main()
{
int a[50],l,j,t,n;
pritnf(“Enter total element to be sorted\n”);
scanf(“%d”,&n);
for(l=0;l{
printf(“enter a number\n”);
scanf(“%d”,&a[l]);
}
for(l=0; lfor(j=0 ;jif(a[j]< a[a+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
printf(sorted list\n”);
for(l=0; lprintf(“%d\n”,a[j]);
getch();
}


Posted by: Wasim Javed

No comments:

Post a Comment