C program to find nearest lesser and greater element in an array
Given an array of N elements and we have to find nearest lesser and nearest greater element using C program.
Example:
Input:
Enter the number of elements for the arrray : 3
Enter the elements for array_1..
array_1[0] : 1
array_1[1] : 2
array_1[2] : 3
Enter the number : 2
Output:
Element lesser than 2 is : 1
Element greater than 2 is : 3
Program to find nearest lesser and nearest greater element in an array in C
Output
need an explanation for this answer? contact us directly to get an explanation for this answer