Given an unsorted array arr[] and a number n. You need to write a program to find if there exists a pair of elements in the array whose difference is n.
Answers
Answered by
0
Answer:
Take an unsorted array of size 15 and type int from the user and a
number n, find if there exists a pair of elements in the array whose difference is n.
Examples:
Input: arr[] = {5, 20, 3, 2, 50, 80}, n = 78
Output: Pair Found: (2, 80)
Input: arr[] = {90, 70, 20, 80, 50}, n = 45
Output: No Such Pair
Similar questions
Biology,
5 months ago
World Languages,
5 months ago
English,
11 months ago
Computer Science,
11 months ago
Biology,
1 year ago
Business Studies,
1 year ago