From 777213ed5ecbd58b585d1f8fae4dd7caa0696a6c Mon Sep 17 00:00:00 2001 From: Jaskirat singh <44332209+singhjaskirat984@users.noreply.github.com> Date: Sat, 12 Oct 2019 10:19:36 +0530 Subject: [PATCH] BubbleSort.cpp Bubble Sort made by jaskirat singh, cse-1, 3rd yr, GTBIT, 05413202717 --- BubbleSort.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 BubbleSort.cpp diff --git a/BubbleSort.cpp b/BubbleSort.cpp new file mode 100644 index 0000000..b2e7977 --- /dev/null +++ b/BubbleSort.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +using namespace std; + +int main() { + int i,j,arr[100],temp,size; + cout<<"enter the size of the array\n"; + cin>>size; + cout<<"\nenter the array"; + for(i=0;i>arr[i]; + } + + for(i=0;i arr[j+1]){ + temp = arr[j]; + arr[j] = arr[j+1]; + arr[j+1] = temp; + } + } + } + + cout<<"sorted array is-"; + for(i=0;i