1

Assumption static Array in the code

[10, 4, 5, 1, 7, 9, 0, 2, 99]

Maximum is: 99 Minimum is: 0

  • Does this answer your question? [Find the min/max element of an array in JavaScript](https://stackoverflow.com/questions/1669190/find-the-min-max-element-of-an-array-in-javascript) – TBA Oct 14 '21 at 07:04
  • HI @Umair Hamid. Could you clarify which progrmaming language you are using? It would be useful as well to add this langauge [as a tag](https://stackoverflow.com/help/tagging) so that those interested in that language have a better chance of seeing your question sooner. – tjheslin1 Oct 15 '21 at 09:56

1 Answers1

0

You can simply use the .min() and .max() functions build in to python (if that is what you are using) and use the following code which will store the minimum and maximum values of the array in the variables minimum and maximum.

array = [10, 4, 5, 1, 7, 9, 0, 2, 99]
minimum = array.min()
maximum = array.max()
Masterbond7
  • 99
  • 11