Question: Write a program that finds the smallest and second smallest value in a array with N items. The program receives the integer N on the

Write a program that finds the smallest and second smallest value in a array with N items. The program receives the integer N on the command line, creating a random array with N items with double numbers in the range [-20.0, 20.0) and then find the smallest and second smallest segment in the random array. The program should print these two items.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!