Wed Jan 23, 2013 1:55 am
#include <stdio.h>
int euclid(int a,int b)
{
if(b==0)
return a;
else
return euclid(b,a%b);
}
int main()
{
int n1,n2;
printf("Enter two numbers to find its GCD:");
scanf("%d %d",&n1,&n2);
printf("The GCD of %d and %d is %d\n",n1,n2,euclid(n1,n2));
return 0;
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.