#include /* Write a function called factorial (see incomplete version below), The function takes one integer parameter, and returns the factorial of that value. If the value passed to the function is less than 0, print an appropriate error message and return 0. You can use code from the lecture slides as a starting point. */ /*Then, write a (preliminary) program which tests the factorial function by calling it (in a loop, of course!) and printing the result for all values from -10 to +100 (those limits should be constants LOWTESTVALUE and HIGHTESTVALUE). Run the program repeatedly, and by trial and error, determine the largest integer for which your program finds the correct answer (call that LASTGOODVALUE). Then, modify the program so that when it runs through the test values, it will pause ("enter a key to continue") for one value before and four values after LASTGOODVALUE, then continue without pausing through the rest of the test values. The program should print a message to identify when it reaches the LASTGOODVALUE. You can see how the sample executable does it -- but your value MIGHT be different! THe final version of the program should display a message (at the end of exectution) stating what type of computer and compiler you used for testing the program. Hint: while you are testing, change the LOWTESTVALUE and HIGHTESTVALUE to focus on a smaller range, so the answers don't scoll off the screen. Be sure to change to range back to -10 to 50 before turning in. */ #define LOTESTVALUE -10 #define HIGHTESTVALUE 100 int factorial (int ivalue) { return 0; //stub value } /* * WaitForWaitForAnyKeyToContinue * ----------------------- * Input: n/a * Output: n/a * Prompt the user and wait until he/she presses a non-white-space key. */ #define WAIT_MESSAGE "\nHit any character, then enter to continue\n" void WaitForAnyKeyToContinue(void) { char c1; printf(WAIT_MESSAGE); scanf(" %c", &c1); /* " %c" is needed to consume leading white-space */ } int main (void) { WaitForAnyKeyToContinue (); return 0; }