Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

2. Answer the question, Who should do the appraising?

Answered: 1 week ago