In a loop, calculate the factorial for a given n
. For each iteration, use printf
to show the current state of your factorial calculation. Choose a return type that can hold the largest possible factorial. If a calculation will get too large, and cause an overflow, cap the calculation at the previous value.
The stub of your calculate factorial function will be something like this:
unsigned long long calculateFactorial(int n)
{
unsigned long long factorial;
/* Create a loop to calculate the factorial of n. */
/* Print the progress of your calculation using */
/* %llu as your printf format specifier. */
return factorial;
}
2
solved Understanding a factorial function assignment [closed]