Dim oddInput As Integer = CInt(TextBox1.Text)
Dim oddInput2 As Integer = CInt(TextBox2.Text)
Dim start As Integer = 2
Dim countTotal As Integer = 0
While start <= oddInput & oddInput2
countTotal = countTotal + 1
start = start + 2
End While
MessageBox.Show("มีจำนวนทั้งหมด " & countTotal & " ตัว", "จำนวนคู่" & oddInput & "-" & oddInput2)
End Sub
Tag : ASP.NET, VB.NET, VS 2003 (.NET 1.1), VS 2005 (.NET 2.x), VS 2008 (.NET 3.x), VS 2010 (.NET 4.x)