Computer Science, asked by kawalb4597, 1 year ago

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 manishadhiman31
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