Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

Write a script called FindFactorial.m to do the following:- Ask user to input an integer (k)- Find the smallest integer (n) for which the factorial n! is greater than k Your script can have just one loop and you may NOT use MATLAB built-in function to calculate factorial.Run your script for k = 123456 and find the result.

OpenStudy (anonymous):

How about this: ```python k = input('Please enter an integer k:'); n = 0; n_factorial = 1; while n_factorial <= k n = n + 1; n_factorial = n_factorial * n; end fprintf('%d! > %d\r\n', n, k); fprintf('%d! = %d\r\n', n, n_factorial); ``` I tested it here: http://www.tutorialspoint.com/execute_matlab_online.php

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!