Question: Fix This code so it can return a factorial result of 7! This program is written in C #include 1 2 3 int factorial (int

 Fix This code so it can return a factorial result of

Fix This code so it can return a factorial result of 7! This program is written in C #include 1 2 3 int factorial (int n); 4 5 6 int main() { int n, i; factorial(n); 7 8 9 int factorial (int n) [ int i, product; 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 product = 1; /* Computes the product n x (n-1) x (n-2) x... x 2 x 1 */ for (i = n; i = 1; --i) { product = product * i; } /* Returns function result */ return (product)

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!