For a As Integer = 1 To 1000 num = num * 2 If num >= 10 Then position = position + 1 'When value reaches > 10 the position is moved on 1 place Number(position) = 1 + Carry Carry = 1 num = num - 10 For b As Integer = 1 To position Number(B)/> = Number(B)/> * 2 + Carry If Number(B)/> >= 10 Then Carry = 1 Number(B)/> = Number(B)/> - 10 Else Carry = 0 End If Next End If Carry = 0 Next For c As Integer = 1 To position sum = sum + Number(c) 'Adds all integers found Next Console.WriteLine(sum) 'Displays sum Console.Read()

The value output is : 624 (which is incorrect)