diff --git a/sorting/c-or-cpp/selection-sort.cpp b/sorting/c-or-cpp/selection-sort.cpp new file mode 100644 index 00000000..629f0eb2 --- /dev/null +++ b/sorting/c-or-cpp/selection-sort.cpp @@ -0,0 +1,33 @@ +# include +using namespace std; + +int main(int argc, char const *argv[]) +{ // length of array + cout<<"Enter the length of array"<>n; + int arr[n]; + // Getting elements of array + cout<<"Enter the elements of array"<>arr[i]; + } + for (int i = 0; i < n; i++) + { + for(int j = i; j