#include #include "prompt.h" #include "bigint.h" using namespace std; // illustrates loop and integer overflow BigInt Factorial(int num); int main() { int highValue = PromptRange("enter max value for factorial",1,50); int current = 0; // compute factorial of this value while (current <= highValue) { cout << current << "! = " << Factorial(current) << endl; current += 1; } return 0; } BigInt Factorial(int num) // precondition: num >= 0 // postcondition returns num! { BigInt product = 1; int count = 0; while (count < num) // invariant: product == count! { count += 1; product *= count; } return product; }