C program for bubble sort:
void main()
{
int i,j,k,a[10],n;
clrscr();
printf("How many values you want to enter\n");
scanf("%d",&n);
for(i=0;i<=n-1;i++)
{
printf(" %d no?\n",i+1);
scanf("%d",&a[i]);
}
for (i=0;i<=n-1;i++)
for(j=0;j
{
if (a[j]>a[j+1])
{ k=a[j+1];
a[j+1]=a[j];
a[j]=k;
}
}
for(i=0;i<=n-1;i++) printf("%d\n",a[i]);
getch();
}