Answer:
Following are the program in the C++ Programming Language:
#include <iostream> //header file
using namespace std; //namespace
int biggerDigits(int n, int m) { //define function
if (n <= 0 || m <= 0) { //set if statement
return 0;
}
else { //set else statement
int a,b; //set integer variables
a = n % 10; //perform modulatio
b = m % 10; //perform modulatio
int max = a; //set integer variable and assign value
if (b > max) //set if statement
max = b; //initialize value to max
/*solution is here*/
return 10 * biggerDigits(n / 10, m / 10) + max;
}
}
int main() // main method
{ // code is refer from question to make the program
cout << biggerDigits(567, 765) << endl; // call the function biggerdigits
cout << biggerDigits(123456, 444444) << endl; // call the function biggerdigits
//call function and print result
cout << biggerDigits(999, 111) << endl; // call the function biggerdigits
return 0; // return the integer 0
}
Explanation:
Here, we set the header file "<iostream>" and namespace "std" then, we set a function "biggerDigits()" and pass two integer type arguments inside it.