+ Post a Comment HERE!   + Ask a Question / Post a Topic
Results 1 to 2 of 2

write a recursive algorithm to find the GCD of two numbers.

Advert.

  1. #1
    riya03
    riya03 is offline Just in!

    write a recursive algorithm to find the GCD of two numbers.

    Advert.
    ans me plz

  2. #2

    Thumbs up Write a recursive algorithm to find the GCD of two numbers.?

    GCD algorithm....
    GCD(BIG,SMALL)
    BIG=SMALL*INTEGER + REMAINDER
    SMALL=REMAINDER*INTEGER + REM#2
    REMAINDER=REM#2*INTEGER+REM#3
    When the remainder is 0, then the answer is what's being multiplied by an integer.
    Example
    GCD(1071,1029)
    1071=1029*1 + 42
    1029=42*24 + 21
    42=21*2+0
    GCD=21

+ Post a Comment HERE!

Similar Topics and Discussions

  1. Design recursive algorithm to traverse a binary tree represented in linked lists
    By dcoolzia in forum Computer Programming and Designing
  2. LG DVD writer wont write.stucks at 1 percent & stops but start write when abort
    By Noob in forum Computer Hardware Troubleshooting
  3. data structure and algorithm
    By sipsun in forum College & Universities related Discussion
  4. algorithm Hand simulate Selection Sort
    By aarav in forum College & Universities related Discussion
  5. algorithm
    By Guest in forum College & Universities related Discussion
X
Have Question? Ask now free!