Skip to main content
1-Visitor
October 8, 2010
Question

Finding the number and the index of the biggest number in an array thats less than X

  • October 8, 2010
  • 1 reply
  • 4363 views

Can anyone help me?

I've got an array of 10 accending numbers that go from from 1 to 3000. I want to find what the biggest number thats less than or equal to 2000. e.g. if the array was 1,10,27,200,422,1500,1999,2500,2950, 3000 I would want the number 1999 and its index (6).

Thanks

1 reply

12-Amethyst
October 8, 2010

In the attached one method.

Regards. Alvaro.

October 8, 2010

Or another

regards

Andy