#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
Recommended Answers
Jump to PostYou need to list header file names, not just the preprossor command include.
You may need to include a statement regarding namespace std depending on your compiler.
main() should always have return type int, not void.
I've never tried to output a string literal equal to this: …
All 4 Replies
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.