answersLogoWhite

0

#include<stdio.h>

int gcd (int a, int b) {

if (a==0) return b;

if (b==0) return a;

return a<b ? gcd (a, b%a) : gcd (b, a%b);

}

int main (void) {

int a, b;

printf ("Enter two integers: ")

scanf ("%d\n", &a);

scanf ("%d\n", &b);

printf ("The GCD of %d and %d is %d\n", a, b, gcd (a, b));

return 0;

}

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

What is the least common divisor of 180 and 150?

The least common divisor of any set of integers is 1.


What is the least common divisor of 18?

It is not possible to give a sensible answer to this question. The least common divisor (LCD) refers to a divisor that is COMMON to two or more numbers. You have only one number in the question!


What is the greatest common divisor of 118 and 119?

The GCF of consecutive integers is 1.


What is the greatest common divisor of 3 and 4?

The GCF of consecutive integers is 1.


What is the least common divisor or 160 and 12100?

The least common factor of any set of integers is 1.


What is the least common divisor of 36 and 45?

The least common factor of any set of positive integers is 1.


What is the GCM?

In mathematics, the greatest common divisor is also known as the greatest common factor (gcf), highest common factor (hcf), greatest common measure (gcm), or highest common divisor.


What do prime and composite have in common?

They both describe integers.


What is the greatest common divisor of 6A?

Cannot be answered because in math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


What is the greatest common divisor of 120?

Cannot be answered because in math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


What is the greatest common divisor of 11?

Cannot be answered because in math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


Greatest common divisor of x and y cannot be?

Greater than x or y (?)