diff --git a/BUBBLESO.CPP b/BUBBLESO.CPP new file mode 100644 index 0000000..51d7cdb --- /dev/null +++ b/BUBBLESO.CPP @@ -0,0 +1,32 @@ +#include +#include +void bubbleSort(int ar[],int n) +{ + for(int i=0;iar[j+1]) + { + int temp=ar[j]; + ar[j]=ar[j+1]; + ar[j+1]=temp; + } +} +void main() +{ + clrscr(); + int arr[10],n,k,i,item; + cout<<"Enter size of array (max. 10 elements) : "; + cin>>n; + cout<<"Enter elements in array : "<>arr[i]; + } + bubbleSort(arr,n); + cout<<"Sorted array : "<