Computer Science, asked by lagsejohns8465, 5 hours ago

how many is the number of interchanges required to sort 5,1,6,24 in ascending order using bubble sort. show your steps c language

Answers

Answered by ayush985890
0

Answer:

int main()

{

int n,i;

scanf("%d",&n);

int a[n];

for(i=0;i<n;i++)

{

scanf("%d",&a[i]);

}

for(i=0;i<n;i++)

{

if(a[i]>a[i+1]{

int temp=a[i];

a[i]=a[i+1];

a[i+1]=temp;

}

printf("%d",a[i]);

return 0;

}

Similar questions