1. Engineering
  2. Computer Science
  3. cryptography computer security greatest common divisor assignment instructions in software...

Question: cryptography computer security greatest common divisor assignment instructions in software...

Question details

Cryptography Computer Security

Greatest Common Divisor Assignment

Instructions

In software, implement the Euclidean algorithm to find the greatest common divisor of any two positive integers.

It should implement the pseudocode provided in the text. It should allow the user to enter two integers.  

Your program should output the intermediate values of q, r1, r2 for each step and should return the greatest common divisor.

Challenge component: Allow the user's input to be zero as well as the positive integers. Provide error checking and a response if the user enters a negative integer as input.

This is an individual assignment.

Upload the following.

1) a file of the code

2) screenshots of output for at least 4 pairs of inputs.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution