From b270f5306d1e1e9b8023172bcfe24c9c47889230 Mon Sep 17 00:00:00 2001 From: suchit1999 <45621996+suchit1999@users.noreply.github.com> Date: Mon, 14 Oct 2019 12:24:47 +0530 Subject: [PATCH] Create bubbleshort.cpp --- CPP/Data Structure/bubbleshort.cpp | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 CPP/Data Structure/bubbleshort.cpp diff --git a/CPP/Data Structure/bubbleshort.cpp b/CPP/Data Structure/bubbleshort.cpp new file mode 100644 index 0000000..967ee48 --- /dev/null +++ b/CPP/Data Structure/bubbleshort.cpp @@ -0,0 +1,34 @@ +#include +#include +void bubble_sorting(int [],int); +void main() +{ + int a[50]; + int n; + cout<<"enter how many numbers you will be sort"; + cin>>n; + cout<<"enter the values\n"; + for(int i=0;i>a[i]; + bubble_sorting(a,n); + double b[5]={5.8,6.8,9.3,2.6,4.5}; + bubble_sorting(b,n); + cout<<"the sorted array is:-\n "; + for(i=0;i void bubble_sorting(x *a,int size) +{ + int round,i; + x temp; + for(round=0;rounda[i+1]) + { + temp=a[i]; + a[i]=a[i+1]; + a[i+1]=temp; + } +}