Answer:
The function is as follows:
int gcd(int num1, int num2){
if (num2 != 0){
return gcd(num2, num1 % num2);}
else {
return num1;}
}
Step-by-step explanation:
This defines the function
int gcd(int num1, int num2){
This is repeated while num2 is not 2
if (num2 != 0){
This calls the function recursively
return gcd(num2, num1 % num2);}
When num2 is 0
else {
This returns the num1 as the gcd
return num1;}
}