Answer to Question #303977 in Electrical Engineering for Manish

Question #303977

A-3: Write a function that takes an array of integers as input and prints the second-maximum difference between any two elements from an array.






Example:





int arr[]={14, 12, 70, 15, 95, 65, 22, 30};





First max-difference = 95-12=83





Second max-difference = 95 -14 = 81





So output should be 81

0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS