Find the number of the last negative element in the sequence. For example, if A = {2.4, –3.0.5, –2.5}, the result is 6 (number –2).

How to implement this on QBASIC?

thank you very much

  • BASIC ... School years ... Computer "Agat" ... - skegg
  • one
    Home chtoli? - sinedsem 5:58 pm

1 answer 1

Cycle through the entire array. check the array element if it is less than 0 (negative); remember its number in the variable. When all the iterations of the array have passed, you will have in the variable the number of the element which is the last negative.

and how it will look in the code do it yourself for you to decide no one will.