title: Visual Basic Number selector code
body: <p>Im currently developing a math game in visual basic but I need some help with a certain set of code.</p>
  
  <p>I need the random numbers selected in the code: <code>Dim Result0 = Rnd1.Next(10, 20)</code>, to always end in 0 or 2 so numbers like 13 and 15 wont be selected. I need to do this because im making a division game so if a random question like 10/6 comes up I have to enter a long decimal digit which is just annoying. Here is the full code. </p>
  
  <pre><code>Public Class Division
      Dim Rnd1 As New Random
      Dim Rnd2 As New Random
      Dim Result0 = Rnd1.Next(10, 20)
      Dim Result1 = Rnd1.Next(1, 10)
      Dim Total = Result0 / Result1
      Dim Score As Integer = 0
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          Me.KeyPreview = True
          TextBox1.Text = Result0
          TextBox2.Text = Result1
          Label3.Text = Total
          Label4.Text = Score
  
      End Sub
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles  Button1.Click
      Dim Rnd1 As New Random
      Dim Rnd2 As New Random
      Dim Result0 = Rnd1.Next(10, 20)
      Dim Result1 = Rnd1.Next(1, 10)
      Dim Total = Result0 / Result1
  
      If TextBox3.Text = Label3.Text Then
          Score += 1
          TextBox3.Text = ""
      Else
          MessageBox.Show("Incorrect")
          TextBox3.Text = ""
      End If
      TextBox1.Text = Result0
      TextBox2.Text = Result1
      Label3.Text = Total
      Label4.Text = Score
  
  End Sub
  
  Private Sub Form1_Click(sender As Object, e As EventArgs) Handles Me.Click
  
  End Sub
  
  Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
  
      If e.KeyCode = Keys.Enter Then
          e.SuppressKeyPress = True
          Button1.PerformClick()
      End If
  
  
  End Sub
  End Class
  </code></pre>