Question: Write a function MyFactorial which for a given integer n computes n!. The function should gracefully handle inappropriate inputs, such as n being negative
Write a function MyFactorial which for a given integer n computes n!. The function should gracefully handle inappropriate inputs, such as n being negative or not being an integer, by printing an error message and exiting. The function should return n! for valid inputs. In your MATLAB live script, write a script that displays the smallest value of n such that MyFactorial (n) is no longer an integer, due to the limitations of floating-point numbers.
Step by Step Solution
There are 3 Steps involved in it
To solve the problem in the attached image we need to Part 1 Creating the MyFactorial Function We will create a function MyFactorial that calculates t... View full answer
Get step-by-step solutions from verified subject matter experts
