Question: Problem-2 ( 3 points): What does the following program do? You must describe the idea and the logic of the program. #include int whatIsThis(const int

Problem-2 ( 3 points): What does the following program do? You must describe the idea and the logic of the program. \#include int whatIsThis(const int b[], int p);// function prototype If function main begins program execution int main(void) \& const int SIZE =10; int x; I/ hotds return value of function whatIsthis If instiatize array a int a [SIZE ]={1,2,3,4,5,6,7,8,9,10}; x= whatIsThis (a, SIZE) std: : cout x; b // end main // what does this function do? int whatIsThis (const int b[], int p ) \{ I/ base case if (1=p){ return b[0]; \} // end if else { // recursion step return b[p1] + whatIsThis (b,p1); \} /l end else \} // end function whatIsThis
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
