Question: 2. Euclidean Algorithm is used to find the greatest common divisor of two positive integers. Below is the pseudo code for the Euclidean Algorithm. 1.

 2. Euclidean Algorithm is used to find the greatest common divisor

2. Euclidean Algorithm is used to find the greatest common divisor of two positive integers. Below is the pseudo code for the Euclidean Algorithm. 1. Read 2 integers, numl and num2 2. If numl and num2 is positive integers 2.1 If numl larger than or equal to num2 then m-numi and n num2 2.2 If num2 larger than numl then menum2 and n-numl 2.3 Repeat until remainder is 0 2-3. 1 remainder m%n 2.3.2 m-n 2.3.3 n-remainder 2.4 Display m as the greatest common divisor 3. Else, display an error message "The numbers entered are not positive integers" a. Draw a flow chart based on the pseudo code. [8 Marks] b. Write a C++ program based on the pseudo code. [8 Marks]

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!