Question: Write c/c++ code to implement the pseudo code of the GCD algorithm given in this assignment. Doing any other type of algorithm will not be
Write c/c++ code to implement the pseudo code of the GCD algorithm given in this assignment. Doing any other type of algorithm will not be allowed. Assume that the data inputs are 16-bit integers. Define your own gcd function, call it myGCD. The program should ask the user to Enter two numbers, and it will then output the GCD value. The code should take into considerations the special cases of X=Y, and it should output a special statement since X is equal to Y, the GCD is equal to the initial value of X follow by the statement GCD=X=Y=initial_value_of_x. The code should give an error if either X or Y being negative. Name your file mygcd1.c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
