Total members 11893 |It is currently Fri Nov 15, 2024 7:21 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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;
}




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  
 polyalphabetic J# Code     -  
 US Zip Code Validation     -  



Topic Tags

C++ Algorithms
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
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