How to write the function int SuperSum(int n); which finds the sum of Sum(1)+Sum(2)+...+Sum(n) (question #1). Use it to find the sum of (1)+(1+2)+...+(1+2+3+4+5+6+7+8+9+10)??
This is a discussion on Need some insight with these sets within the C++ Programming forums, part of the General Programming Boards category; How to write the function int SuperSum(int n); which finds the sum of Sum(1)+Sum(2)+...+Sum(n) (question #1). Use it to find ...
How to write the function int SuperSum(int n); which finds the sum of Sum(1)+Sum(2)+...+Sum(n) (question #1). Use it to find the sum of (1)+(1+2)+...+(1+2+3+4+5+6+7+8+9+10)??
Write a function int Sum(int n); which will find the sum 1+2+3+...+n. Use it to find the sum of 1+2+...+100
How to write the function int SuperSum(int n); which finds the sum of Sum(1)+Sum(2)+...+Sum(n) (question #1). Use it to find the sum of (1)+(1+2)+...+(1+2+3+4+5+6+7+8+9+10)??
My guess is that you are expected to use a loop.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
So basically you're calculating the number of presents in the 12 days of Christmas...
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Isn't it the same as sum(n = 0, n =12) n * (12 - n) (in my fail math notation)
Last edited by whiteflags; 12-20-2011 at 01:32 PM. Reason: yay, calculation error!