0

Write a program in c++ to sum the series 1+2+3+...+n

I need answer asap...am confused 😕

9th May 2018, 5:56 PM
Favour MBONU
Favour MBONU - avatar
3 Respostas
0
You need the program to sum infinitley in ascending order?
12th May 2022, 7:19 PM
Luca Salviani
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; }
12th May 2022, 7:23 PM
Luca Salviani
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.
12th May 2022, 7:27 PM
Luca Salviani