NO

Author Topic: Greatest Common Divisor  (Read 3172 times)

Hoborob

  • Guest
Greatest Common Divisor
« on: August 26, 2011, 03:54:10 AM »
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

  • Guest
Re: Greatest Common Divisor
« Reply #1 on: August 26, 2011, 04:28:21 AM »
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.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 775
Re: Greatest Common Divisor
« Reply #2 on: August 26, 2011, 10:07:46 PM »
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

  • Guest
Re: Greatest Common Divisor
« Reply #3 on: August 26, 2011, 10:40:55 PM »
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

  • Guest
Re: Greatest Common Divisor
« Reply #4 on: August 26, 2011, 10:44:09 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