Ask your own question, for FREE!
Computer Science 18 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!
Latest Questions
Breathless: Spooky witch but cute
1 hour ago 1 Reply 0 Medals
Arriyanalol: help
1 hour ago 7 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
20 hours ago 5 Replies 3 Medals
Jaded012023: Please tell me what you all think of this song
1 hour ago 6 Replies 1 Medal
Arriyanalol: bro how
1 hour ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
20 hours ago 12 Replies 2 Medals
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!