Showing posts with label Print all pairs with given sum. Show all posts
Showing posts with label Print all pairs with given sum. Show all posts

How to find pair of numbers to get magic sum

Given an array of integers, and a number 'magic', print all the pairs in the array whose sum is equal to 'magic'. If we don't find any pair to get that 'magic' number then...