Computer Science, asked by AshlynnCouture, 10 months ago

write a c++ program to accept any 100 numbers as input and find and display the sum of them.

Answers

Answered by vigneshsatheesh
0

Answer:

You can modify this program as per your needs

Explanation:

#include <iostream>

using namespace std;

int main()

{

   int n, sum = 0;

   cout << "Enter a positive integer: ";

   cin >> n;

   for (int i = 1; i <= n; ++i) {

       sum += i;

   }

   cout << "Sum = " << sum;

   return 0;

}

Similar questions