RSS Forums RSS
Please support our C++ advertiser: Programming Forums

help with Greatest common divisor

Join Date: Jun 2005
Posts: 7
Reputation: dark7angelx07 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dark7angelx07 dark7angelx07 is offline Offline
Newbie Poster

Re: help with Greatest common divisor

  #8  
Jul 2nd, 2005
This is the correct code:

/* prototype for gcd */ = int GCD (int a, int b);

<< /* function call for gcd */<<"\n\n"; = << GCD(a, b) << "\n\n";

/*header for gcd */ = GCD(int x, int y);



All of the above is correct... all we need to figure out is the if statement to determine if both x and y are divisible by i..I could not figure that out...

I tried everything like if(x+y % i) but nothing worked can someone help??

if( /* condition to see if both x and y are divisible by i */ )-->Does anyone know how to do this?????? :o
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:10 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC