Computer Science, asked by keerthijoy902, 1 month ago

write a C++ program to find the sum of n natural numbers using for loop​

Answers

Answered by ItzAnonymousgirl
2

At the end of the loop, sum will have the right value, so print it. You can try: int sum = startingNumber; for (int i=0; i < positiveInteger; i++) { sum += i; } cout << sum; But much easier is to note that the sum 1+2+.

Hope it helps you

Answered by vinaysinghal29012000
0

Answer:

55

Explanation:

Attachments:
Similar questions