diff --git a/CPP/Data Structure/bubbleshort.cpp b/CPP/Data Structure/bubbleshort.cpp new file mode 100644 index 0000000..967ee48 --- /dev/null +++ b/CPP/Data Structure/bubbleshort.cpp @@ -0,0 +1,34 @@ +#include +#include +void bubble_sorting(int [],int); +void main() +{ + int a[50]; + int n; + cout<<"enter how many numbers you will be sort"; + cin>>n; + cout<<"enter the values\n"; + for(int i=0;i>a[i]; + bubble_sorting(a,n); + double b[5]={5.8,6.8,9.3,2.6,4.5}; + bubble_sorting(b,n); + cout<<"the sorted array is:-\n "; + for(i=0;i void bubble_sorting(x *a,int size) +{ + int round,i; + x temp; + for(round=0;rounda[i+1]) + { + temp=a[i]; + a[i]=a[i+1]; + a[i+1]=temp; + } +}