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 the number: \n");
- scanf("%d%d",&n1,&n2);
- for(i=0;i<=n1&&i<=n2;i++)
- {
- if(n1%i==0 && n2%i==0)
- {
- gcd=i;
- }
- }
- printf("%d",gcd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement