Question: use language c ( Use a while loop for this problem ) Write a function that computes the factorial of an integer. The two function

use language c (Use a while loop for this problem) Write a function that computes the factorial of an integer. The
two function parameters are the non-negative integer whose factorial is to be calculated, and a pointer indicating
the location to which the result should the written. The function should return 0 in case of successful execution or
return -1 in case of malformed/bad input.
int while_factorial(int n, int *factorial); //function prototype
Part B: Repeat Part A, except this time use a for loop.
int for_factorial(int n, int *factorial); //function prototype

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!