### Output for Two Arrays Not Displaying Correctly

My program is working but the output isn't displaying as it should.

Here's the INPUT:
62 61 59 64 60 54 57 53 60 55

And this is how the OUTPUT should display:
Current heights: 62 61 59 64 60 54 57 53 60 55
Expected heights: 65.1 64.05 61.95 67.2 63 56.7 59.85 55.65 63 57.75

Any help fixing this issue would be appreciated. Here's my code:

 ``1234567891011121314151617181920212223242526272829303132`` `````` #include using namespace std; int main() { double height[10]; double expHeight[10]; for (int x = 0; x < 10; x = x + 1) { height[x] = 0.0; } cout << "You are asked to enter heights (in inches) of 10 students. " << endl << endl; for (int x = 0; x < 10; x = x + 1) { cout << "Enter the height of a student: "; cin >> height[x]; expHeight[x] = height[x] * 1.05; } for (int x = 0; x < 10; x = x + 1) { cout << "Current heights: " << height[x] << endl; cout << "Expected heights: " << expHeight[x] << endl; } system("pause"); return 0; }``````

 ``123456789101112131415`` ``````cout << "Current heights: "; for ( int x = 0; x < 10; x = x + 1 ) { cout << height[x] << ' '; } cout << endl; cout << "Expected heights: " for ( int x = 0; x < 10; x = x + 1 ) { cout << expHeight[x] << ' '; } cout << endl; ``````
Thanks, Vlad! It works perfectly now...
Topic archived. No new replies allowed.