solving C++ problem

Mar 10, 2009 at 3:32pm
i encounter problems in doing this program,,can anybody help me? plzzz..
this is the problem..im just only a beginner and my professor is giving us confusing C++ problems..

Write a C++ program that will read in a number N and then output the sum of the squares of the numbers from 1 to N.

plsss help me..
Mar 10, 2009 at 3:41pm
Write some code and we will help you if you have problems with that but we won't do your homework

http://www.cplusplus.com/forum/articles/1295/
Mar 10, 2009 at 3:54pm
First of all this is not a hard problem. Maybe a tad confusing but..

Here is how I would start:

- Get N from the user
- Run a for loop from i = 1 to N
- Inside the loop add i^2 to a total variable
- Output the total variable
Topic archived. No new replies allowed.