Question: in c++ 21. Write a function, whose arguments are a 1-dimensional integer array, and its dimension n. The function will find and return the average

in c++
21. Write a function, whose arguments are a 1-dimensional integer array, and its dimension n. The function will find and return the average of the positive values only. If there are no positive values then return -1. Also write the prototype and the function call. 22. Write a block of code using a C++ structure that counts separately two values: the number of string. Assume the user already input a string named submarine where the digits will be and 2's in the found te a value returning function whose arguments are an array of type int and an integer representing the number of elements in the array. The function returns the range Range is defined as max minus min value. 23. Writ 24. Write a recursive function that returns the factorial of an integer n, the only parameter passed to this function. Write the same factorial function in non-recursively form. 25. The Fibonacci numbers are defined as a,-0, a, ? , and a.-4-ta-2 for all integers n 2. write a 1 complete program, which includes a return value recursive function called Fibonacci. From main issue a single call to this function to store the first 30 Fibonacci numbers in an array and then print them to the screen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
