Answer:
The solution code is as follows:
- #include <iostream>
- using namespace std;
- int main()
- {
- int myArray [10] = {};
-
- int i;
- for( i = 0; i < 10; i++ )
- {
- cout <<"Enter an integer: ";
- cin>> myArray[i];
- }
- }
Explanation:
Firstly, we initialize a 10-elements array, myArray (Line 7) with no values.
Next, we create a for-loop (Line 10). Within the loop, we prompt user to enter an integer and assign the input value to the current element of myArray (Line 12-13).