1. Display the following prompt: "Enter the number for the factorial calculation (0 to 8):"
2 Accept the number from the keyboard as an ASCII string.
3. Convert the string to a numeric value.
4. Call a subroutine that calculates the factorial of the number.
5. Convert the result to an ASCII string and display it on the screen.
6. Terminate the program when a key such as "Q" is pressed.
N.B. Keep the following in mind:
1. The value must be passed to both subroutines as a parameter on the stack. The result should also be
passed back to the calling program on the stack.
50
2. Use either of the following two algorithms as guidelines for your subroutines:
Iterative function FactIter (N):
Result = 1;
For I = 2 to N do
Result = Result * I;
FactIter = Result;
Recursive function FactRec (N):
If N = 1 then
FactRec = 1
else
FactRec = N * FactRec (N-1);