title: Sum of the first 100 even and odd number?
body: <p>I need some help getting this code to work. I need the code to calculate the first 100 even and odd numbers. The code below shows the even portion, but I assume they both will work the same way, just with different numbers. I know that the first 100 even numbers are 2 to 200 or 0 to 200?, and the first 100 odd numbers are 1 to 199. (I also need to use while loops, would I use a separate while loop to determine how the code calculate the sum?)</p>
  <p>here is the code.</p>
  <pre><code>    Dim sum, count As Integer 'the sum and count are changing and they must be a whole number. 
      Const num As Integer = 2
      'now we must deveolp a while loop/equation that adds every number lower or equal to 100 together.
  
  
      While count Mod 2 &lt;= 200 'while the count is smaller or equal to 100,
          count =
          sum += count 'The sum will be add or equaled to the count
          count += 1 'The count will be added to equaled to 1 
  
      End While
  
      Console.WriteLine(&quot;The Sum of the first 100 even numbers is: {0}!&quot;, sum) 'This is the text the user sees, which tells them that the sum of the first 100 numbers will be 5050.
  
      Console.ReadLine()
  End Sub
  </code></pre>
  <p>As usual the math portion is giving me trouble. I feel like I have the right idea, but I cant execute it properly.</p>