diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..39daaec68 Binary files /dev/null and b/.DS_Store differ diff --git a/Sorting/Bubble Sort.cpp b/Sorting/Bubble Sort.cpp index f3b4e2260..c94a45efc 100644 --- a/Sorting/Bubble Sort.cpp +++ b/Sorting/Bubble Sort.cpp @@ -5,19 +5,21 @@ using namespace std; int main() { - int Array[6]; + int n; + cin >> n; + int Array[n]; cout<<"\nEnter any 6 Numbers for Unsorted Array : "; - + //Input - for(int i=0; i<6; i++) + for(int i=0; i>Array[i]; } - + //Bubble Sorting - for(int i=0; i<6; i++) + for(int i=0; iArray[j+1]) { @@ -27,10 +29,10 @@ int main() } } } - + //Output cout<<"\nSorted Array : "; - for(int i=0; i<6; i++) + for(int i=0; i