using namespace std; #include #include #include // Hello // Define the digits. // //-- using namespace std; char digits[]= {'0','1','2','3','4','5','6','7','8','9','\0'}; char one[]= {'1', '\0'}; char zero[]= {'0', '\0'}; // Prototypes for functions that perform integer calculations. // char* sum( char a[], char b[] ); // Returns a + b char* diff( char a[], char b[] ); // Returns a - b char* product( char a[], char b[] ); // Returns a * b //-- bool equal( char a[], char b[] ); // True iff a == b // Function to calculate factorial (recursively). // char* factorial( char n[] ) { if (equal( n, zero )) return one; // 0! is 1 if (equal( n, zero )) return one; // 1! is 1 return product( n, factorial( diff(n,one) ) ); // n! = n*(n-1)! } // Now, code the functions to perform arithmetic. // char* sum( char a[], char b[] ) // Returns a + b { int j; for (j=0; j