Coding the given algorithm in python 3, the <em>greatest</em> <em>common </em><em>divisor</em><em> </em>of the values (124 and 244) and (4424 and 2111) are 4 and 1 respectively.
The program implementation goes thus :
def gcd(a, b):
<em>#initialize a function named gcd which takes in two parameters</em>
if a>b:
<em>#checks if a is greater than b</em>
return gcd (b, a)
<em>#if true interchange the Parameters and Recall the function</em>
elif a == 0:
return b
elif a == 1:
return 1
elif((a%2 == 0)and(b%2==0)):
<em>#even numbers leave no remainder when divided by 2, checks if a and b are even</em>
return 2 * gcd(a/2, b/2)
elif((a%2 !=0) and (b%2==0)):
<em>#checks if a is odd and B is even</em>
return gcd(a, b/2)
else :
return gcd(a, b-a)
<em>A</em><em> </em><em>sample</em><em> </em><em>run</em><em> </em><em>if</em><em> </em><em>the</em><em> </em><em>program</em><em> </em><em>on</em><em> </em><em>the</em><em> </em><em>values</em><em> </em><em>given</em><em> </em><em>:</em>
print(gcd(124, 244))
print()
<em>#leaves a space after the first output</em>
print(gcd(4424, 2111))
Learn more :brainly.com/question/25506437
The LCM of 3x( x + 2 ) and 6x(2x -3) is 6x ( x + 2 )( 2 x -3). 6x( x + 2)( 2x -3)
Greetings
this is 90 60 30 formula for example
90 meet 2x
30 meet x
and
60 meet x√3
so 90 meet 5
30 meet 5/2=2.5
and 60 meet 2.5√3
so the answer is 2.5
Answer:
3 miles
Step-by-step explanation:
A trapezoid has an area of 18 square miles. The bases are 5 miles and 7 miles. Using these measurements, the height of this trapezoid is how many miles
Area of a trapezoid = 1/2 (a + b)h
The formula for the height of a trapezoid =
h = 2(A/a + b)
A = 18 square miles
a = 5 miles
b = 7 miles
h = 2(18/5 + 7)
h = 2( 18/12)
h = 2 ( 9/6)
h = 3 miles