Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write c++ code Write a C++ program that defines 2 functions for processing arrays using pointer based notation. 1 function should search through an array
Write c++ code
Write a C++ program that defines 2 functions for processing arrays using pointer based notation. 1 function should search through an array and return the smallest integer element in the array. The other must search for and return the largest integer element. Here are the function headers to use: int findsmallest(cont int. intArray, const int size) int findLargest(cont int intArray, const int size) . Test the program from main by prompting the user for how big the array should be. Next, dynamically allocate an array of the requested size and initialize it with random intgers in the range [-1000, 1000]. Next, call the 2 functions, store their return values, and display the results in a user-friendly format Note: Do not use square bracket notation [ 1 in this program, except for when using the new operator. Use only pointer notation to manipulate the array. Note: whenever you use dynamically allocated memory, it is critical that you remember to de-allocate the memory so that it is returned back to the operating system. ssi gnmen How many integers do you want in the array? 5 Elementeis:613 lement 1 is: .810 nt 2 is 14 ment 3 is: 929 ement 4 is: 43 Bigsest integer: 929 est Integer 81 Press any, key to continue Step 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