From 935714e3d7507106a15cdd66113f0860db9e19e5 Mon Sep 17 00:00:00 2001 From: Puneet Kumar Date: Sat, 3 Oct 2020 11:52:08 +0530 Subject: [PATCH] Create BubbleSort.cpp add sorting program --- BubbleSort.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 BubbleSort.cpp diff --git a/BubbleSort.cpp b/BubbleSort.cpp new file mode 100644 index 0000000..41b794b --- /dev/null +++ b/BubbleSort.cpp @@ -0,0 +1,28 @@ +using namespace std; +#include +void BubbleSort(int a[],int n) +{ + for(int i=0;ia[j+1]) + { + int temp=a[j]; + a[j]=a[j+1]; + a[j+1]=temp; + } + } + } +} + +int main() +{ + int a[]={7,9,5,2,4,1,10}; + BubbleSort(a,7); + for(int i=0;i<7;i++) + { + cout<<" "<