Question: Create a C++ program Below is problem18start.cpp The greatest common denominator (GCD) of two positive integers is the largest integer that divides the numbers exactly.
The greatest common denominator (GCD) of two positive integers is the largest integer that divides the numbers exactly. For example, the GCD of 14 and 21 is 7; for 13 and 22, it is 1.; and for 45 and 27, it is 9. We can write a recursive formula for find the GCD, given that the two numbers are called a and b, as: GCD(a, b) a, if b 0 GCD(a, b)-GCD(b, a%b), if b > 0 I have created a driver program for you. Download the driver program and create a recursive C++ function that implements the recursive formula shown above. You can NOT change any code outside the function in the program provided. You MUST comment which is your base case and which is your general case Download the starter driver program here: problem18start.cpp ? Name your program problenia.cpp and submit it when it compiles and runs correctly. 100 points. The output should look like the output shown below, given input of 110 and 77 NOTE: If you accidentally create an infinite recursive loop, press Ctrl+C to stop it. Command Prompt :Cpp c++ problem18.cpp -o problem18.exe c:ACpp>problem18 Input first number: 110 Input second number: 77 Greatest common denominator (GCD) is 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
