Hi, I want to write a script which will evaluate the lowest factorial which is greater than the user's input, and I am unsure of whether to use a while or a for loop to execute this. Any help is always much appreciated! This is my code so far:
num=input('Enter a number: ');n=0;while (true) n=n+1; f(1i)=factorial(n); if f(1i)>num formatSpec='The factorial greater than %d is %d'; fprintf(formatSpec,num,f); else continue endend
Best Answer