Question: In C++, Create an array of 10 random numbers with a for loop. Save them to a text file. Have the program read that file
In C++,
Create an array of 10 random numbers with a for loop. Save them to a text file.
Have the program read that file and create a new dynamically created array.
Then print the values in the array.this should be done by creating a function that accepts two arguments, a const integer pointer to the array and size. The fuction should be called printValues(const int *arr, int size).
Next, the program should ask the user to enter a value. The program will check the array for any number above that number. A new array will be created from numbers above the users number. The printValues function should be called to print the new array.
Print the new array in reverse . Your program (via a function) should create a new copy of the array, except that the elements should be in reverse. The function should return a pointer to the new array. Then call printValues to show the values of the new array.
Use pointer notation throughout.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
