Computer Science, asked by bgouri2015, 10 months ago

Hiw to find the biggest number and the smallest number of an array in Js

how to find the biggest and the smallest number of an array​

Answers

Answered by vanshverma257
2

Answer:

Algorithm to find the smallest and largest numbers in an array

Input the array elements.

Initialize small = large = arr[0]

Repeat from i = 2 to n.

if(arr[i] > large)

large = arr[i]

if(arr[i] < small)

small = arr[i]

Print small and large

Answered by mahekabidasyed
1

Answer:

bigss bigsset nambar 109 smllest 73

Similar questions