diff --git a/BubbleSort.cpp b/BubbleSort.cpp new file mode 100644 index 0000000..b2e7977 --- /dev/null +++ b/BubbleSort.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +using namespace std; + +int main() { + int i,j,arr[100],temp,size; + cout<<"enter the size of the array\n"; + cin>>size; + cout<<"\nenter the array"; + for(i=0;i>arr[i]; + } + + for(i=0;i arr[j+1]){ + temp = arr[j]; + arr[j] = arr[j+1]; + arr[j+1] = temp; + } + } + } + + cout<<"sorted array is-"; + for(i=0;i