title: For-Next Loop in Visual Basic
body: <p>I want to compute for the binomial coefficient in Visual basic but I can only do the numerator part as I am lost on the denominator part. The equation that I am using is seen in the image below.</p>
  
  <p><a href="http://i.stack.imgur.com/TtJTu.jpg" rel="nofollow">Equations</a></p>
  
  <p>Looking at the C(n,k) equation, I can only do the numerator which is the n factorial. I am having trouble with the denominator. My code for the numerator (n!) is below:</p>
  
  <pre><code>Dim nfactorial As Integer = 1
      For i As Integer = 1 To txt3.Text
         nfactorial *= i
      Next
  </code></pre>
  
  <p>What should I do about the denominator part? Thanks!</p>