Coding challenge

Write some code that will read in two integers, $n$ and $d$. "Pretend" that $n$ is the numerator of a fraction and $d$ is the denominator. Have your code prove that the fraction can be reduced to lowest terms if you divide both $n$ and $d$ by the greatest common divisor of $n$ and $d$. Note that gcd(n,d) is an available function you can use (ex: print(gcd(25,100)) displays 25).

Type your code here:


Lua reference

See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code: