#include <stdio.h>
#include <stdlib.h>
int bubble_sort(int A[],int n)
{
int i,j,temp;
for(i=1;i<n;i++)
{ for(j=0;j<n-1;j++)
{
if(A[j]>A[j+1])
temp=A[j];
A[j]=A[j+1];
A[j+1]=temp;
}
}
}
int main()
{
int A[]={3,9,1,5,8},n=5;
/*printf("enter the total number of elements");
scanf("%d",&n);
printf("enter the Array");
for(int i=0;i<n;i++)
{printf("\n");
scanf("%d",&A[i]);
}*/
bubble_sort(A,n);
for(int k=0;k<n;k++)
{
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KaW50IGJ1YmJsZV9zb3J0KGludCBBW10saW50IG4pCnsKICBpbnQgaSxqLHRlbXA7CgogIGZvcihpPTE7aTxuO2krKykKICB7IGZvcihqPTA7ajxuLTE7aisrKQogICAgewogICAgaWYoQVtqXT5BW2orMV0pCiAgICB0ZW1wPUFbal07CiAgICBBW2pdPUFbaisxXTsKICAgIEFbaisxXT10ZW1wOwogICAgfQogICAgfQoKCiAgfQoKCgppbnQgbWFpbigpCnsKICAgIGludCBBW109ezMsOSwxLDUsOH0sbj01OwogICAgLypwcmludGYoImVudGVyIHRoZSB0b3RhbCBudW1iZXIgb2YgZWxlbWVudHMiKTsKICAgIHNjYW5mKCIlZCIsJm4pOwogICAgcHJpbnRmKCJlbnRlciB0aGUgQXJyYXkiKTsKICAgIGZvcihpbnQgaT0wO2k8bjtpKyspCiAgICB7cHJpbnRmKCJcbiIpOwogICAgc2NhbmYoIiVkIiwmQVtpXSk7CiAgICB9Ki8KCiAgICBidWJibGVfc29ydChBLG4pOwpmb3IoaW50IGs9MDtrPG47aysrKQogICAgewogICAgcHJpbnRmKCIlZCAiLEFba10pOwogICAgfQp9Cg==