Question: in c++ please: Write a recursive function called factorial() to return the factorial of an integer that was inputted from keyboard. The printing of output

in c++ please: Write a recursive function called factorial() to return the factorial of an integer that was inputted from keyboard. The printing of output will be done in the main function.

The factorial of n is n! which is given by n(n-1)(n-2)..2*1

Hence the factorial of 5 is 5X4X3X2X1 = 120. Similarly, the factorial of 4 is 4X3X2X1 = 24

the tests of the assignment( test #5) say it wants a testPassed() function but I don't know where or what to have in it since there is no mention of it in the question

there is also another test under the one mentioned above (test #6) that I don't know how to pass

the code in the screenshots is the code that started with the assignment, not what i tested with

thank you so much in advanced

 in c++ please: Write a recursive function called factorial() to returnthe factorial of an integer that was inputted from keyboard. The printingof output will be done in the main function. The factorial ofn is n! which is given by n(n-1)(n-2)..2*1 Hence the factorial of

5.12 Factorial of an inputted integer Write a recursive function called factorial to return the factorial of an integer that was inputted from keyboard. The printing of output will be done in the main function. The factorial of n is n! which is given by n(n-1)(n-2)..2*1 Hence the factorial of 5 is 5X4X3X2X1 = 120. Similarly, the factorial of 4 is 4X3X2X1 = 24 Ex. If the input is: 5 the output is: The factorial of 5 is 120 287144. 1392722 LAB ACTIVITY 5.12.1: Factorial of an inputted integer 7/11 main.cpp Load default template... 1 #include 2 using namespace std; 3 4 int factorial(int value) 5 { 6 if (value > 0) 7 return value factorial(value-1); 8 return 1; 10 11 int main() { 12 int num; 13 cout > num; 15 16 cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!