Question: Given an array of n integer numbers, and an int number x. write a function to find out whether the sum of any two numbers

 Given an array of n integer numbers, and an int number

Given an array of n integer numbers, and an int number x. write a function to find out whether the sum of any two numbers in the array equals x or not. class FindPair { public static void findPair(int[] A, int x) {...... } public static void main (String[] args) { int A[] = { 8, 7, 2,5, 3, 1 }; int sum = 10; findPair(A, sum); } } Output Pair found at index 0 and 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!