Switch to full style
C code examples
Post a reply

greatest common divisor-code-c

Wed Jan 23, 2013 1:55 am

greatest common divisor implementation code for numbers :
cpp code
#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;
}




Post a reply
  Related Posts  to : greatest common divisor-code-c
 greatest common divisor (GCD)     -  
 Greatest common divisor     -  
 Greatest Comman Divisor using Java     -  
 Error 500: java.lang.NoClassDefFoundError: org.apache.common     -  
 i want code for connecting mobile and pc can u send me code     -  
 Freeman chain code algorithm code     -  
 code     -  
 asking for code     -  
 NotePad C# code     -  
 I need help with a html code     -  

Topic Tags

C++ Algorithms