Question: can ssomeone answer this please! Problem 5: Consider the following Euclid algorithm to compute the greatest common divisor of two integers A and B: algorithm

can ssomeone answer this please!can ssomeone answer this please! Problem 5: Consider the following Euclid algorithm

Problem 5: Consider the following Euclid algorithm to compute the greatest common divisor of two integers A and B: algorithm Euclid GCD; var A, B, Q, M, N: integer; begin read(A, B); if A >= B then begin M:= A; N:= B; end; else begin M:= B; N:= A; end; Q:= MIN; R:= M-N* Q; while Ro0 do begin not guay begin M:= N; N:= R; Q:= MIN; R:= M-N* Q; end; CouTwrite(The GCD of "A," and "B," is ", N); end. 1. What are the values taken by each variable during the execution of Euclid algorithm each of the following pairs of values read in A and B? 18 and 6; 28 and 12; 15 and 25; 32 and 21. Write the correspondino C+program

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!