Greatest Common Divisor

Started by Hoborob, August 26, 2011, 03:54:10 AM

Previous topic - Next topic

Hoborob

I am working on a program were one of the functions needs to find the greatest cmmon divisor for two fractions. The request I have is for some ideas on how to accomplish this function.

CommonTater

Well, I'd start here...  http://en.wikipedia.org/wiki/Greatest_common_divisor

Once you know the mechanics, you need to work the problem with pencil and paper so that you can see each step in the process... then just convert your notes to C code.

It's 4 pretty simple steps...  Understand -> Plan -> Write -> Test.

If you get stuck post your code in the Beginner's forum and ask some specific questions.  They guys here are pretty smart and I'm sure you'll get your solutions.

However... don't expect anyone to do your homework for you.  We have our own work to do.

Bitbeisser

Quote from: CommonTater on August 26, 2011, 04:28:21 AM
If you get stuck post your code in the Beginner's forum and ask some specific questions.  They guys here are pretty smart and I'm sure you'll get your solutions.

However... don't expect anyone to do your homework for you.  We have our own work to do.
Looks like school has started again...  ;D

Ralf

Hoborob

Not to worry I have already found a method to find a GCD and have impletmented the code. I do appreciate the direction to look. Turns out the code needed to do the job was only about 5 lines of code and it does work very well. Agian thanks for the direction.

CommonTater

Quote from: Bitbeisser on August 26, 2011, 10:07:46 PM
Looks like school has started again...  ;D
Ralf

Round these parts it's the first full week in September, but I'm guessing some are just finishing summer school and make up assignments...  Let the fun begin! ;D