2 Replies Latest reply: Nov 4, 2007 9:44 AM by 807603 RSS

    sum  of odd numbers code help

    807603
      calculates and returns the sum of all the odd numbers from 1 to x.?

      this is what i have so far:
      for (count = 1; i = x; i++)
      {
      sum = 0;
      count + 2;
      sum = count
      }
      i = i + 2

      when i compile, i get an error because count + 2; is not a statement. why? Your help is greatly appreciated.