Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In c++ language please 1. Standard Input/Output 1-1 You must write two functions. The first function, readNumbers, is to read a set of 10 numbers
In c++ language please
1. Standard Input/Output 1-1 You must write two functions. The first function, readNumbers, is to read a set of 10 numbers from std::cin and use them to initialise a dynamically allocated array of int of length 10. The function must return a pointer to the array. You may assume that the input contains 10 integer values and nothing else. The second function, printNumbers, takes an int array of any length greater than 0 and prints all numbers in the array, one per line. The numbers must be printed in order starting with the first entry. Each line of output should start with the array index of the number being written out, followed by a space, then the number and finally a newline. For example, if the numbers 5 2 34 35 6 78-9 10 are read by the program, the output should be: 0 5 1 2 2 3 4 35 5 6 6 7 7 8 8-9 9 10 The main function for this problem must call your readNumbers function, then pass the new array to your printNumbers function and finally delete the array. The signatures for your two functions are int *readNumbersO; void printNumbersCint numbers, int length) The readNumbers and printNumbers functions must be placed in the file function-1-1.cpp and the main function in the file main-1-1.cppStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started