Max and Min

Write a program MaxAndMin that creates an Array of ten integers chosen randomly between -100 and +100 inclusive. Display the initial list of values. Then write a loop to run through the list of integers, looking for:

  1. the location of the largest value in the Array
  2. the value of that largest integer
  3. the location of the smallest value in the Array
  4. the value of that smallest integer

Sample output:

The array of random values: 
95 -23 8 61 -12 95 79 4 -83 -75  

Largest value 95 is at index 0
Smallest value -83 is at index 8