admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Write a program to find all pairs of an integer array whose sum is equal to a given number.

Hardik Patel
12 Posts

Write a program to find all pairs of an integer array whose sum is equal to a given number.

Input :

          1. Array of N element

          2. Sum

          E.g :

                  arr[] = {1, 5, 7, -1, 5}

                  sum = 6

Output : 

          Counts of Pairs and indices of elements to be sumed.

          Count of pairs is 3

          0, 1
          0, 4
          2, 3 

         

      

Published By : Hardik Patel
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin