C program for finding gcd of given numbers using functions
Answers
Answered by
0
int main() {
int a, b;
printf("Enter 2 numbers:");
scanf("%d%d", & a, & b);
printf("Greatest Common Divisor is %d", gcd(a, b));
return 0;
}
int gcd(long a, long b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
Similar questions
Math,
7 months ago
English,
7 months ago
Computer Science,
7 months ago
Math,
1 year ago
History,
1 year ago
Social Sciences,
1 year ago
Computer Science,
1 year ago