title: Can anyone explain in detail to me what this line in vb did?
body: <p>I have the code snippet below to tell if a number is prime or not in my vb project. </p>
  
  <pre><code>Public Sub CheckButton_Click(sender As Object, e As EventArgs) Handles CheckButton.Click
  
          Dim myNumber As Integer, myDivider As Integer
          myNumber = Integer.Parse(PrimeTextBox.Text)
  
          Select Case myNumber
              Case Is &lt;= 0
                  MessageBox.Show("I'm only accepting values above 0. :p")
                  Exit Sub
          End Select
  
          For myDivider = 2 To (myNumber - 1)
              If myNumber Mod myDivider = 0 Then
                  MessageBox.Show(" " &amp; myNumber &amp; " is not a prime Number")
                  Exit For
              End If
          Next
  
          If (myDivider &gt; (myNumber / myDivider)) Then
              MessageBox.Show(" " &amp; myNumber &amp; " is a prime number")
          End If
  End Sub
  </code></pre>
  
  <p>I understand all that's going on up until the lines:</p>
  
  <pre><code>If (myDivider &gt; (myNumber / myDivider)) Then
  
          MessageBox.Show(" " &amp; myNumber &amp; " is a prime number")
  
      End If
  </code></pre>
  
  <p>I just can't understand what the lines above do, all I know is when I remove these lines from my code, numbers like 9, 21, 99 ... are all detected as prime numbers, which is incorrect. </p>
  
  <p>I understand that the first <code>For</code> loop checks if the number typed in by the user is evenly divisible by any number from 2 to the number - 1 cause obviously, a prime number can be divided by only itself and 1.</p>
  
  <p>I'd like someone to explain to me clearly what those lines do exactly in my code, for now I only know it helps to check if numbers like 9, 99... are prime or not. Thanks.</p>