0% found this document useful (0 votes)
33 views1 page

Bubble Sort

The document describes bubble sort algorithm to sort an array of integers. It takes array size and elements as input, compares adjacent elements and swaps them if not in order until fully sorted.

Uploaded by

Ravan bhoye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Bubble Sort

The document describes bubble sort algorithm to sort an array of integers. It takes array size and elements as input, compares adjacent elements and swaps them if not in order until fully sorted.

Uploaded by

Ravan bhoye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

//BUBBLE SORT..

#include<stdio.h>

# include<conio.h>

int main()

int a[30],si,i,j,temp=0;

printf("\n\t\n\tBUBBLE SORT");

printf("\n\tEnter size of array:");

scanf("%d",&si);

printf("\n\tEnter the array element:\n");

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

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

printf("the sorted list is:\n");

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

for(j=0;j<si-1;j++)

if(a[j]>a[j+1])

temp=a[j];

a[j]=a[j+1];

a[j+1]=temp;

}}}

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

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

return 0;}

You might also like