Announcement

Collapse
No announcement yet.

Reading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    Code:
      DIM largest AS LONG
      DIM smallest AS LONG
      DIM i AS LONG
      DIM numbers(9) AS LONG
    
      ' you should fill numbers() array with your own numbers here  
      FOR i = 0 TO UBOUND(numbers())
        numbers(i) = RND * 1000 - 500
      NEXT i
    
      largest = numbers(0)
      smallest = numbers(0)
      FOR i = 0 TO UBOUND(numbers())
        IF numbers(i) > largest THEN largest = numbers(i)
        IF numbers(i) < smallest THEN smallest = numbers(i)
      NEXT i
      PRINT "Largest number is: " + STR$(largest)
      PRINT "Smallest number is: " + STR$(smallest)



    ------------------
    http://www.sublevel6.f2s.com/

    Leave a comment:


  • Karl Bellagio
    started a topic Reading

    Reading

    How can I read a list of numbers(data) and then find the largest
    and smallest values. I am stumpted. I need help.



    -------------
    Kro121
Working...
X