Question: Write a program that reads 100 double numbers and stores them in an array. The program should calculate the distance between successive elements and display
Write a program that reads 100 double numbers and stores them in an array.
The program should calculate the distance between successive elements and display the minimum one.
To calculate the distance of two elements, subtract their values and use the absolute value.
For example, if the first four elements are 5.2, -3.2, 7.5,12.22, the distances are |-3.2-5.2| = 8.4, |7.5-(-3.2)| = 10.7 and |12.22-7.5| = 4.72.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
