Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<process.h>
- void gcd(int,int);
- void main()
- {
- int a,b;
- printf("\nEnter the nos ");
- scanf("%d%d",&a,&b);
- gcd(a,b);
- }
- void gcd(int a,int b)
- {
- if(a==0)
- {
- printf("\nGCD is %d",b);
- exit(0);
- }
- a>=b?gcd(a%b,b):gcd(b%a,a);
- }
Advertisement
Add Comment
Please, Sign In to add comment