diff --git a/Selection sort.cpp b/Selection sort.cpp new file mode 100644 index 0000000..22ddf0f --- /dev/null +++ b/Selection sort.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; +void swapping(int &a, int &b) { + int temp; + temp = a; + a = b; + b = temp; +} +void display(int *array, int size) { + for(int i = 0; i> n; + int arr[n]; + cout << "Enter elements:" << endl; + for(int i = 0; i> arr[i]; + } + cout << "Array before Sorting: "; + display(arr, n); + selectionSort(arr, n); + cout << "Array after Sorting: "; + display(arr, n); +} \ No newline at end of file