diff --git a/SortingAlgorithms/C++/Bubble_Sort.cpp b/SortingAlgorithms/C++/Bubble_Sort.cpp new file mode 100644 index 0000000..b92b85f --- /dev/null +++ b/SortingAlgorithms/C++/Bubble_Sort.cpp @@ -0,0 +1,37 @@ +#include +using namespace std; + +void bubble_sort(int a[],int n){ + int t; + for(int i=0;i>n; + int a[n]; + cout<<"Enter the elements: "; + + for(int i=0;i>a[i]; + } + + bubble_sort(a,n); + + cout<<"Sorted array: "; + for(int i=0;i + +using namespace std; + + +int main() { + int n; + cin>>n; + int a[n]; + for(int i=0;i>a[i]; + + } + for(int i=n-1;i>=0;i--){ + cout<