0
Write a program in c++ to sum the series 1+2+3+...+n
I need answer asap...am confused đ
3 Answers
0
You need the program to sum infinitley in ascending order?
0
What i can think of is the following
Note: im using a for so that the loop ends at some point but if you need it to sum infinitly you can change it to while with an argument that doesnt ever ocurr so that the loop never ends.
Int count =0;
for(int j=1; j>10;j++)
{
count += j;
}
0
Dont forget to start your variables at a certain number, in this case 0 so that you dont get residual numbers from the memory. Hope it helped! :) if you dont understand something ask, my english isnt the best but ill try to explain myself better.