Question: C++ PART B- FIND GCD USING CONSECUTIVE INTEGER CHECKING ALGORITHM DESCRIPTION Consecutive Integer Checking Algorithm also solves the problem of finding the greatest common divisor
C++

PART B- FIND GCD USING CONSECUTIVE INTEGER CHECKING ALGORITHM DESCRIPTION Consecutive Integer Checking Algorithm also solves the problem of finding the greatest common divisor of two non-negative, non- zero integers. You will create a program that will calculate the greatest common divisor of two integers based on the Consecutive Integer Checking Algorithm. SPECIFICATIONS Your source code should be contained in a single file and should be named your TTU email address excluding the "@students.tntech.edu" and an underscore and a 'B' to indicate part B (example: acrockett_B.cpp) Write a C++ program to find the greatest common divisor of two numbers m and n based on the Consecutive Integer Checking Algorithm Your program should be able to calculate the greatest common divisor for all inputs for which it is defined; you may assume the input values can be stored in an int data type. Your program will take in two command arguments specifying the value of m and n, and will write to standard output the text "gcd(lml,[nl) Iv" where [ml, [nl, and [v] are the values of m, n, and gcd(m,n), respectively. In the case where the greatest common divisor is not defined, you will print the text "gcd(m],In]) is undefined." Refer to the sample output. SAMPLE OUTPUT WindowslSystem321cmd.exe : \Users acrockett\Desktop\CSC\CSC Fall 2018 CSC240e\PROGRAMS>run 943857 384 gcd (943857, 384) is 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
