Expand|Select|Wrap|Line Numbers

- #include <stdio.h>
- int gcd(int a, int b);
- int main(void)
- {
- int a, b,r;
- printf("Please input two positive integers");
- scanf("%d%d", &a, &b);
- gcd(a, b);
- if (gcd(b, r))
- printf("%d", gcd);
- }
- int gcd(int a, int b)
- {
- int r;
- if ((r = a % b) == 0)
- return b;
- else
- return gcd(b, r);
- }