Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n1, n2, i, gcd;
- printf("Enter two integers: ");
- scanf("%d %d", &n1, &n2);
- for(i=1;i <= n1 && i <= n2; i++)
- {
- if(n1%i==0 && n2%i==0)
- gcd = i;
- }
- printf("%d", gcd);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement