#include
void bubblesort(int a[], int n);
void main()
{
int a[20],n,i;
clrscr();
fflush(stdin);
printf("Enter the size of the array\n");
scanf("%d",&n);
printf("Enter the elements of the array\n");
for(i=0;i
scanf("%d",&a[i]);
}
bubblesort(a,n);
printf("The sorted elements are\n");
for(i=0;i
printf("%d\n",a[i]);
}
getch();
}
void bubblesort(int a[],int n)
{
int temp,i,j;
for(i=0;i
temp=a[i];
for(j=0;j
if(temp {
temp=a[j];
a[j]=a[i];
a[i]=temp;
}
}
}
}
