Comparison between numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • farmerlife26
    New Member
    • Feb 2008
    • 1

    Comparison between numbers

    I am trying to do a homework assignment using VB 2005. This assignment require that I compare numbers using the IF statement. The number range will be from 60 to 130, and there will be an output box that will keep the highest number between that have been entered that is in between 60 and 130. There will also be an output box that keep the lowest number between 60 and 130.

    I think what i should write:

    If last input > current input then
    txtHighestNumbe r.Text = last input
    txtLowestNumber .Text = current input
    elseif last input < current input then
    txtHighestNumbe r.Text = current input
    txtLowestNumber .Text = last input
    End if

    But this is only what i think should be written, i don't know the code to represent the last input and current input. For this project there is only one place to enter the number, and so there need to be a way to represent previous inputs.

    Can anyone help me?

    Thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    1.Accept 2 number s from the user
    2.Check if the numbers in the range of 60 - 130
    3.Compare both the numbers to find out the highest value.
    4.Display the high and low value.
    5.Else if the numbers are same prompt again to enter a new value.

    Comment

    Working...