addition off odd numbers and "small numbers" less than number 5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • memas
    New Member
    • Feb 2010
    • 3

    addition off odd numbers and "small numbers" less than number 5

    i want help
    1.how to found odd numbers on my 6 textboxes and make the addition of them
    2. how to found "small numbers" less than number 5 and make the addition of them
    example

    1+3+7=11 odd
    1+2+3+4+=10 small nubers less than 5
    thank you
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What is the logic that you are working on ?

    Comment

    • memas
      New Member
      • Feb 2010
      • 3

      #3
      logic?
      what means logic

      Comment

      • vb5prgrmr
        Recognized Expert Contributor
        • Oct 2009
        • 305

        #4
        Logic,... means that a computer is completly logical as any answer is either a 1 or a 0, no in between. Logic, means what code have you written to tell the computer what you want to do. Logic, means the step by step process you will have to go through to figure out how you want the computer to go step by step to solve your problem...

        Comment

        • memas
          New Member
          • Feb 2010
          • 3

          #5
          this is the code but i dont know how to make the addition of the odd numbers
          Dim myTextBoxes As New List(Of TextBox) 'convert the textboxes to new list

          myTextBoxes.Add (Me.num20TextBo x) 'this is my collection
          myTextBoxes.Add (Me.num21TextBo x)
          myTextBoxes.Add (Me.num22TextBo x)

          Dim memas, count As Integer 'this is a counter
          count = 0 'that counter starts to 0
          For Each txt As TextBox In myTextBoxes 'loop for.....next
          If Integer.TryPars e(txt.Text, memas) Then
          If (memas And 1) = 1 Then
          count += 1
          num35TextBox.Te xt = count.ToString 'mona
          Else
          num35TextBox.Te xt = count.ToString 'zyga
          End If
          End If
          Next

          Comment

          Working...