Here's another way to do this depending on what exactly you are looking for. I can't post the link for some reason which is really annoying :(....
Wow your code is so much simpler and easier to use :). Thx for the code. I'm just stubborn about making up my own stuff sometimes.
Wouldn't this code also cover both cases of GCD whether your first variable is bigger or your second variable is bigger? void gcd(int x, int y)...
Separate names with a comma.