diff --git a/Arrays/find_sum_pair.cpp b/Arrays/find_sum_pair.cpp new file mode 100644 index 0000000..860c204 --- /dev/null +++ b/Arrays/find_sum_pair.cpp @@ -0,0 +1,27 @@ +#include +#include +using namespace std; + +// in unsorted array + +int main () { + int arr[] = {2,3,1,6,5,4}; + int sum = 9; + int n = sizeof(arr)/sizeof(int); + int i = 0 , j=n-1; + sort(arr,arr+n); + while(isum) { + j--; + } + else if(arr[i]+ arr[j]