Question: 9. [10] Write a small program that implements the Extended Euclidean algorithm to find the greatest common divisor. The program should output the god and

 9. [10] Write a small program that implements the Extended Euclidean

9. [10] Write a small program that implements the Extended Euclidean algorithm to find the greatest common divisor. The program should output the god and x and y. Input should be two non-negative integers a and b, with a > b. Your program should also provide an option to calculate the inverse of a number with some modulus for the user. Submit a screen shot showing all the working features of your program along with a print out of your code. You can use the pseudocode below, but you don't have to. You can use online sources, just be sure to document. The key is for you to have a tool on your computer that you understand how to use and are confident in its correctness. 2.107 Algorithm Extended Euclidean algorithm INPUT: two non-negative integers a and b with a > b. OUTPUT: d=gcd(a, b) and integers T, y satisfying ar + by = d. 1. Ifb=0 then set d a, 2+1, y o, and return(d,x,y). 2. Set 12+1, 1140, 4240, 411. 3. While b > 0 do the following: 3.1 q- a/b], rta - qb, c22 - 421, yy2 - 4y1. 3.2 ab, br, 22421, 212, 4241, and y1y. 4. Set dta, 22, y 42, and return(d,x,y)

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!