Question: What am I missing with my code? C++ Question: Load 10 integers into an array, then prompt the user for a number from 0 to

What am I missing with my code? C++

Question:

Load 10 integers into an array, then prompt the user for a number from 0 to 9. Display the element at the array position the user selects. For example:

Reading in: 77, 33, 88, 99, 22, 55, 11, 44, 66, 0 Enter a number from 0 to 9: 3 Element number 3 is 99 

Code:

#include using namespace std;

int main() { cout>arr[i]; } cout>n; cout

My Output vs Expected:

What am I missing with my code? C++ Question: Load 10 integers

into an array, then prompt the user for a number from 0

to 9. Display the element at the array position the user selects.

1 Compare output Input 55 Reading in: Enter a number from 0 to 9: 3 Element number 3 is 99 Your output Reading in: 77, 33, 88, 99, 22, 55, 11, 44, 66, 3 Expected output Enter a number from 0 to 9 Element number 3 is 99

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!