#include #include "bigint.h" using namespace std; // illustrates loop and integer overflow // displays a table of factorials between 0 and an input number BigInt Factorial(int num); int main() { int highValue; // variable to store the upper bounf for the factorial table int current = 0; // compute factorial of this value cout << "Enter the number up to which factorials will be calculated: "; cin >> highValue; 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) { count += 1; product *= count; } return product; }