How to make a basic addition problem. I want the program to say enter a number 10 times. Like this
enter a number..(x10)
repeating that 10 times then the final result is all of them added together. I always thought of something like this just never seen it done before this is what I attempted its says what I want but it doesn't add them.
#include <string>
#include <iostream>
#include <vector>
usingnamespace std;
int main()
{
int sum = 0;
for(int i = 0; i < 100; i++)
{
cout << "Enter a number..(" << i << "/" << 100 << ")" << endl;
int number;
cin >> number;
sum += number;
}
// Add output for sum
}