Answer:
- n = 10;
- f = n;
-
- while(n > 1)
- n = n - 1;
- f = f * n;
- end
-
- disp(f);
Step-by-step explanation:
The solution code is written in Matlab.
Firstly, we initialize n to 10 and set n to f variable (Line 1-2).
Next, create a while loop that will continue to loop until n is equal or smaller than one. In the loop, decrement n by one and multiply n with current f_variable.
At last display value of f. The output is 3628800.