Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int nod(int a, int b)
- {
- if (a == 0)
- return b;
- return nod(b%a, a);
- }
- int main()
- {
- int a, b;
- printf("Enter a: ");
- scanf("%d", &a);
- printf("Enter b: ");
- scanf("%d", &b);
- printf("Greatest common divisor of %d and %d is: %d", a, b, nod(a, b));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement