About the target pair sum

i share my code to you and tell me how to sort these pairs in increasing or decreasing order

Hello @manoj2597 you can use the inbuilt sort algorithm sort(a,a+n).
For this you have to include header file algorithm.

https://ide.codingblocks.com/s/379757

i want to write this pair sum in only increasing order. can u help me to solve this

Hey @manoj2597 what question you are trying to solve?
Could you please elaborate what pair you want to sort ?

i am sharing code with you and in this code i want ouput as increasing order and not repeatinghttps://ide.codingblocks.com/s/379757
i want output as 1and4
2 and 3
not 4 and 1
3 and 2

why in inbuilt sort algo it ends at a+n sort(a,a+n)

hey @manoj2597 check this i have reframed your logic .
https://ide.codingblocks.com/s/379928.
inbuilt sort algo works like sort(a,a+n)
in this a is the starting element of the array and a+n is the last element of the array and we have to sort every elements in between and including them .
if you have any doubt you can ask here .
Happy Learning !!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.