Write a java program that reads 5 numbers from user into an array and prints the…
- User
Write a java program that reads 5 numbers from user into an array and prints the smallest and largest number and their location in the array. Sample Input1: 7 13 2 10 6
Sample Output1: The largest number 13 was found at location 1. The smallest number 2 was found at location 2.
Sample Input2:
2 4 -5 12 3
Sample Output2:
The largest number 12 was found at location 3. The smallest number -5 was found at location 2.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.