We're not here to do your homework. But we can help you with particular problems.
Show us what you did. Where you are struck.
Start with developing the algorithm - how do you find GCD of 125 and 75? (Hint: 25). 200 and 13? (Hint: 1)
Once you can do that, start thinking how to put that in computer code.