Question: programming language . + . . + 1/ CLASS WORK - W4 Label it CW4.cpp // Description: Write a program that will find the value
programming language


. + . . + 1/ CLASS WORK - W4 Label it CW4.cpp // Description: Write a program that will find the value of nl when the user enters n, where n is a non-negative number up to 12 The factorial will calculated 2 ways: (1) With a regular function name Ifactorial (2) With a recursive function named Rfactorial Afterwards print both values and be sure they are equall // 1. Declare the needed variables. There will be one use input) // 2. Immediately call the functions passing the number n // 3. For the Ifactorial use a loop to calculate n! // 4. For the Rfactorial you CANNOT use a loop. // The recursive behavior will handle the computation. // 5. Print both values and check they are equal. // 1/ Note: Recall: 5! = 5 * 4 * 3 * 2 1 - 120 // 0! = 1 // // *** * #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
