From 137a12d6f9b8fa8cac422efe6d17a6d262592f61 Mon Sep 17 00:00:00 2001 From: saurabh meena <57886471+hawkeye41@users.noreply.github.com> Date: Sat, 2 Oct 2021 00:58:34 +0530 Subject: [PATCH] Create bubble-sort.cpp --- bubble-sort.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 bubble-sort.cpp diff --git a/bubble-sort.cpp b/bubble-sort.cpp new file mode 100644 index 00000000..809d33fc --- /dev/null +++ b/bubble-sort.cpp @@ -0,0 +1,29 @@ +#include +using namespace std; +int main() +{ + int n; + cin>>n; + + int arr[n]; + + for(int i=0; i>arr[i]; + } +int count=1; + while(countarr[i+1]) + swap(arr[i],arr[i+1]); +} +count++; +} +for(int i=0; i