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
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
English,
3 hours ago
English,
5 hours ago
English,
5 hours ago
Geography,
7 months ago
Computer Science,
7 months ago