Question: IE 2 3 0 5 Looping and Function Practice a ) The Least Common Multiple ( LCM ) of two positive integers A and B
IE
Looping and Function Practice
a The Least Common Multiple LCM of two positive integers A and is the smallest positive integer that is divisible by both A and The Greatest Common Divisor GCD of two positive integers A and is the largest integer that divides evenly into both A and If you know either LCM or widehat you can easily calculate the other using: :LCMsubr
b Write a Sub that asks the user for two positive integers using input boxes. The code should then call a function that finds either LCM or GCD your choice The sub should then calculate the one your function didn't find using the formula given in the last sentence of part The code should then output onto a worksheet A B LCM, and GCD with headers. Each time the user runs the sub, the new numbers should go directly under the previous run. In the screenshot below, the Sub was run times. The first time rows and are populated. The second time, row and is overwritten are populated. The third time row and
c Write either a LCM or GCD function, whichever is easier for you. The function you write will be the one you call in your Sub from part
d Here are some correct answers so that you will know when you are on the right track. I ran the sub times to get this result.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
