Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts

    get minimum and maximum number

    if I have variables age1,age2,age3,age4,age5, and age6

    How would I get the minimum and maximum age?

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    id put them in an array, loop through them and run 1 ifs inside
    intMin = 0
    intMax = 0
    ages = Array(.., .., .., .., .., ..)
    for...
    if ages(i) < intMin Then intMin = ages(i)
    if ages(i) > intMax Then intMax = ages(i)
    next


    sry i couldnt write it all im in a bit of a rush


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •