Thou shalt not attempt to create an array of variable size
Code:
cout << "Please enter the amount of numbers you want to calculate: ";
cin >> j;
int numbers[j]; <-- illegal in c++
Your options are:
1. declare an array of an arbitrary fixed size
2. use a dynamic array and create an array of any given size at runtime
Code:
cout << "Please enter the amount of numbers you want to calculate: ";
cin >> j;
int *numbers = new int[j];
3. Use an STL object such as <vector>. A vector class object simulates a resizable array.
Code:
#include<vector>
vector<int> numbers;
int input = 0;
cout << "Please enter number " << i << ":" << endl;
cin >> input;
numbers.push_back(input);