Question: Write a method that returns the index of the smallest element in an array of integers. If the number of such elements is greater than
Write a method that returns the index of the smallest element in an array of integers. If the number of such elements is greater than 1, return the smallest index. Use the following header:
public static int indexOfSmallestElement(double[] array)
Write a test program that prompts the user to enter ten numbers, invokes this method to return the index of the smallest element, and displays the index.
Step by Step Solution
3.32 Rating (170 Votes )
There are 3 Steps involved in it
Output Enter five numbers 5 6 7 5 4 3 6 2 8 1 The index of smallest number is 2 ... View full answer
Get step-by-step solutions from verified subject matter experts
