# Algorithm for gcd of two numbers using the function recursion

Posted by on

• Level 1:

An expert who has achieved level 1.

Hot-Shot:

An expert who has answered 20 questions.

Corporal:

An expert that hasĀ over 10 points.

Mayor:

An expert whose answer gotĀ voted for 2 times.

• Contributor

Function gcd(a, b) if b = 0 return a else return gcd(b, a mod b)

Posted on Jun 11, 2010

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
goodluck!

Posted on Jan 02, 2017

×

my-video-file.mp4

×

## Related Questions:

### How do I change a percentage to a fraction

Use this http://www.calculatorsoup.com/calculators/math/percent-to-fraction-calculator.php
OR to work it out yourself.....#

### How to convert percent to fraction

1. Divide the percent by 100 to get decimal number.
2. Count the number of digits (d) to the right of the decimal point of the decimal number.Example: 2.56 has 2 digits to the right of the decimal point, so d=2.
3. Calculate the factor (f) for making the decimal number an integer: f = 10 to power d
Example:
f = 10 power 2 = 100
4. Multiply and divide the decimal number x by the factor f: x * f / f = y / f
Example:
2.56 * 100 / 100 = 256 / 100
5. Find the greatest common divisor (gcd) of the fraction. Example:
gcd(256,100) = 4
6. Reduce the fraction by dividing the numerator and denominator by the gcd value: Example:
256 / 100 = (256/4) / (100/4) = 64/25
Example One percent is equal to one hundredth:
1% = 1/100
So in order to convert percent to fraction, divide the percent by 100% and reduce the fraction.
For example 56% is equal to 56/100 with gcd=4 is equal to 14/25:
56% = 56/100 = 14/25

Sep 07, 2014 | Office Equipment & Supplies

### Where is the GCF/GCD button on my TI-85 Plus Silver Edition

There are no such buttons, You'll find the lcm (least common multiple) and gcd (greatest common divisor) functions in the MATH NUM menu. Press MATH, right-arrow, and select the desired function.

Jul 07, 2011 | Texas Instruments TI-84 Plus Silver...

### What do you mean recurrence relation in computer science? advantage and disadvantages in recurrence relation in computer science? what do you mean sequence? in computer science? what are the importance...

Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem. The approach can be applied to many types of problems, and is one of the central ideas of computer science.Most computer programming languages support recursion by allowing a function to call itself within the program text. Some functional programming languages do not define any looping constructs but rely solely on recursion to repeatedly call code. Computability theory has proven that these recursive-only languages are mathematically equivalent to the imperative languages, meaning they can solve the same kinds of problems even without the typical control structures like "while" and "for".In computer science, a list or sequence is an abstract data structure that implements an ordered collection of values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence, that is, a tuple. Each instance of a value in the list is usually called an item, entry, or element of the list; if the same value occurs multiple times, each occurrence is considered a distinct item.

Jun 30, 2011 | Computers & Internet

### I need to replace the laser assembly on a ADCOM GCD-750

I thought it used a KSS-240 which is a Sony laser.
# will be on the laser and Mcm has it for I think \$35

Apr 16, 2010 | Adcom GCD-750 CD Player

### JavaBat.Com

/* REXX is better than JAVA */
input = '17273747'
x = count7(input)
say 'number of "7" characters is:' x
exit

count7: parse arg digit 2 tail
if digit = ' ' then return(0)
match = (digit = '7')
return (match + count7(tail))

i.e., split the "input" into the 1st column and the "tail" (the other columns).
If there is no "first" column, return '0' ("none").
Test the 1st column.
Recursively call the function, passing the "second-through-last" columns, adding-in the result (0 or 1) from the 1st column.

Mar 26, 2010 | Sun Java Programming Language (cdj-275)

### How do i fix stack overflow on line 144

A stack overflowis caused by recursion. You have an area of reserved memory called the stack when you call a function which calls itself you have what is called recursion.

If the recursive loop never ends you will run out of memory and get a stack overflow error.

If it is code you have written then check your code for recursion and replace with a while loop <- you can only use while loops

If the code was written by someone else - such as a website then inform the webmaster@ whatever domain name they have and hope they fix the problem soon.

Oct 08, 2009 | Computers & Internet

### How to do gcd on the ti-84

Hello,

Press [MATH] Right arrow to [NUM] Scroll down till you find 9:gcd( [ENTER]
The command will appear on Home screen as gcd(. You enter first number, then a comma, then the 2nd number, and close the right parenthesis
Exemple gcd(3,21) [ENTER] gives 3 as result.

Hope it helps

May 25, 2009 | Texas Instruments TI-84 Plus Calculator

### Input a number and then show the fibonacci sequence of the input number in a C++ program.

I'm assuming one of two things, either

A) You need help for a programming class?

or

B) You're just curious?

Either way

#include <iostream>
#include <algorithm>
using std::swap;
using std::cout;
using std::endl;
// Function f returns n'th Fibonacci number
// It uses Algorithm 2C: non-recursive loop
unsigned int f(unsigned int x) {
unsigned int x1=1;
for(unsigned int i=1,x2=1;i<=x;i++) {
x1+=x2;
swap(x1,x2);
}
return x1;
}
// Function f_print prints out n'th Fibonacci number
void f_print(int n) {
cout << n << "th Fibonacci number is " << f(n) << endl;
}
// main is the entry point in C++
int main() {
f_print(46);
}

Feb 18, 2009 | Computers & Internet

### Code for prime numbers in c

Prime numbers can be calculated by using recursive algorithm
int i,j=1;
i++;
for (j=2;j<i;j++)
{
If (i%j==0)printf(" %d number is prime",&i );
else printf(" %d number is not prime",&i);
i++;
delay(20);
}
Ctrl break to terminate execution or other

Jan 29, 2009 | Computers & Internet

Is there a specific question or just generalities? Open up the top and the Sony optics number should be right on the optic assembly. I believe that it uses a KSS-240 optics assembly. What else do you need?
Dan

Mar 30, 2008 | Adcom GCD-700 5-Disc CD Changer

## Open Questions:

#### Related Topics:

55 people viewed this question

Level 3 Expert

Level 3 Expert