Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 (10 Points) Greatest Common Divisor Two integers A and B have the greatest common divisor which is the largest positive integer that divides

image text in transcribed
Question 3 (10 Points) Greatest Common Divisor Two integers A and B have the greatest common divisor which is the largest positive integer that divides A and B, evenly, without a remainder. One way to find the Greatest Common Divisor is to consider the prime factors for A = 372 and B = 84 as shown below. 372 = 22.3.31 84 = 22.3.7 GCD(372,84) - 22.3 = 12 In a well-documented Python program, hmwk3Q3.py, query the user for two integers. Use a while.loop to find the remainder R when dividing A by B.Replace the value of A with the value of B and replace the value of B with the value of R. Continue this process within the while-loop until the value of B is zero. At that time the value of A will be the GCD. In a comment, provide the response to your program when A = 98,025,733,547 and B = 2,345,109,894,323. Grading: Comments (+2 points). Input software to query for A and B (+2 points). A correct while-loop (+4 points). The correct value for GCD (+2 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

1. Explain the purpose of performance appraisal.pg 87

Answered: 1 week ago

Question

=+2. How did the study operationally define these variables?

Answered: 1 week ago

Question

What are negative messages? (Objective 1)

Answered: 1 week ago