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
Political Science,
6 months ago
English,
6 months ago
English,
1 year ago
Computer Science,
1 year ago
Biology,
1 year ago
Business Studies,
1 year ago