I'm writing a simple program that needs to take in the number of elements a user wants in their array. The program then needs to read in the elements of the array and display the output. Some rules of the program are:
- The maximum number of integers are to be handled are 20.
- All numbers entered and displayed will be integer values.
For some reason I keep getting the output of the array plus the previous question relayed to the user.
EX:
#include <iostream>
using namespace std;
int main()
{
const int ARRAY_SIZE = 20;
int inputOne = 0;
int arrayOne[ARRAY_SIZE];
cout << "Enter how many numbers you'd like to read in up to 20: ";
cin >> inputOne;
//Input the numbers
for (int input = 0; input < inputOne; input++)
{
cout << "Enter in the numbers: ";
cin >> arrayOne[input];
}
//Display the array
for (int input = 0; input < inputOne; input++)
cout << arrayOne[input];
cout << endl;
system("pause");
return 0;
}

Enter how many numbers you'd like to read in up to 20: 10 Enter in the numbers: 1 Enter in the numbers: 2 Enter in the numbers: 3 Enter in the numbers: 4 Enter in the numbers: 5 Enter in the numbers: 6 Enter in the numbers: 7 Enter in the numbers: 8 Enter in the numbers: 9 Enter in the numbers: 10 12345678910 sh: pause: command not found