Question: (C++ Program) Write a function called readIn which reads in an integer from user and store this value to the integer parameter. Write a recursive
(C++ Program) Write a function called readIn which reads in an integer from user and store this value to the integer parameter. Write a recursive function called doubleOdd, which takes an integer parameter, prints this integer to the screen with all the odd digits in this number doubled, as following Ex: integer parameter 12 -> prints 112 integer parameter 212 -> prints 2112 integer parameter 112 -> prints 11112 Write a recursive function called factorial, that takes a positive integer pameter, then return the factorial of this integer. Ex: factorial (5) -> returns 120 =5*4*3*2*1= 120 Note, factorial (0) is 1 Use the following main function to test the functions. int main(){ int in; readIn(in); cout << in << endl; cout << "Doubled odd "; doubleOdd(in); cout << endl; int f; if (in >= 0) { f = factorial(in); cout << in << "! = " << f << endl; } return 0; } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
