diff --git a/InsertionSort.cpp b/InsertionSort.cpp new file mode 100644 index 000000000..1123543d5 --- /dev/null +++ b/InsertionSort.cpp @@ -0,0 +1,37 @@ +//Bubble Sort + +#include +using namespace std; + +int main() +{ + int Array[6]; + cout<<"\nEnter any 6 Numbers for Unsorted Array : "; + + //Input + for(int i=0; i<6; i++) + { + cin>>Array[i]; + } + + //Sorting + for(int i=1; i<6; i++) + { + int temp=Array[i]; + int j=i-1; + while(j>=0 && temp