Write a MATLAB while-loop code that asks a user to enter an integer number until its factorial is smaller than 100.
Hi,This is working code in MATLAB and its snapshot
f=1;
while(f)
n=input('Enter the value of n ');
fact=factorial(n);
disp(fact);
if(fact<100)
continue;
else
f=0;
end
end
-------------------------------------------------------------------
Still if you have any doubt or need any kind of improvement, please let me know in comment section and if you like, Please upvote.
Thank You !
Get Answers For Free
Most questions answered within 1 hours.