2 Test Cases Failed In Array Target Sum Problem

I did the program and it passed 2 test cases but not working for rest of the test cases. Can you help me where did I do it wrong?
My code link:

You need to sort the array since the o/p order is taken into care

also have lower case β€˜and’
cout << arr[i] << " and "<< arr[j]<< endl;