Question: 2. Now, without changing the original code, fix the program using array. Fix the C++ code at the highlighted lines as shown in Program 6.1.

 2. Now, without changing the original code, fix the program usingarray. Fix the C++ code at the highlighted lines as shown in

2. Now, without changing the original code, fix the program using array. Fix the C++ code at the highlighted lines as shown in Program 6.1. Then compile and run. Input the data as in Figure 6.1. Make sure you display the correct value. /Program 6.1: Working with arrays The main function calls a user-defined function named readData without transfers anything. The myProgram reads the input from the user up to 10 integer numbers. Then, it displays it in reverse order #include #include using namespace std; const int N = 10; void myProgram(void); //prototype of myProgram int main(void) { myProgram(); //calls myProgram and transfers nothing system ("pause"); return 0; 2 } // ******* myProgram function // Read up to 10 integer numbers // Then, write the numbers back to the screen in its reverse order. void myProgram(void) { const int noOfInput = 10; int data[noof Input]-{@}; /*declare data as an array and intialise set element with a cout >data[i]; /*store the input value in the data array } //Display the input in reverse order cout =0; i--) { cout

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!