#include
#include
int gcd (int , int );
void main ()
{
int m, n;
cout<<" Enter first integer:";
cin >>m>>endl;
cout<<" Enter second integer:";
cin >>n>>endl;
cout<<m<<"&"<<n<<" The GCD is:"<<gcd(m,n)<<endl;
}
int gcd (int x, int y)
{
if(y==0)
return x;
else
return gcd(y,x%y);
}
latour1972 0 Newbie Poster
Lerner 582 Nearly a Posting Maven
latour1972 0 Newbie Poster
ShawnCplus 456 Code Monkey Team Colleague
henpecked1 0 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.