Question: This is for C++ 4. Instructions to solve all three problems below using function. The value of n should be asked from user in the

 This is for C++ 4. Instructions to solve all three problems This is for C++

4. Instructions to solve all three problems below using function. The value of n should be asked from user in the main ()and pass the value of n to an additional function as argument value; Ex: Factorial (n) The functions should calculate the values according to the formulas below and return the values Then the main ) function should print out those returned values . All three parts should have their own separate function, since formulas are different. 2a. 15 points Write a function to calculate F-n! 2b. 10 points Write a function to calculate for F whereby n can be equal to any integer and F will be as the following: F 1 2 3 For example, if n-l 0, then F=-+-. 1 2 3 10 2c. 10 points Write a function to calculate for F whereby n can be equal to any integer and F will be as the following: F+t+ 1 2 3! For example, if n= 10, then F-441 1 23 101 Hint: The factorial of a nonnegative integer n is written as n! (Pronounced "n factorial") and is defined as follows n! = n"(n-1 )*(n-2). . . . *I (for values of n greater than or equal to 1 ) and n! for n-0). For example, 5-5*4*3*2*1, which is 120

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!