Question: Find the gcd for the following two problems; use the pseudo code. int main GCD (a, b) {int gcd =0; if (a a) return gcd;

 Find the gcd for the following two problems; use the pseudo

Find the gcd for the following two problems; use the pseudo code. int main GCD (a, b) {int gcd =0; if (a a) return gcd; r1 = a; r2 = b; r = mod(r1, r2); while r > 0 {r1 = r2; r2 = r; r = mod (r1, r2):} if (r == 0) {gcd = r2;}//safety return gcd;}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!