silvertooth07 0 Newbie Poster

we were asked to input a number and display the sum of the odd and even integers.

eg.

number: 10
sum of odd: 25
sum of even: 30

intnum = CInt(txtnum.Text)

        Dim counter% = 1
        Do Until counter = intnum
            intcompare = counter Mod 2
            If intcompare = 0 Then inteven += counter Else intodd += counter
            counter += 1
        Loop
        txteven.Text = inteven
        txtodd.Text = intodd

when i ran the program, i keep on getting 20 instead of 30 for the sum of even integers. the sum of odd is correct.

thanks again~!