#includeiostream using namespace std ; int gcd ( int a , int b ) { if ( a = b ) { if ( a % b == 0 ) return b ; else return gcd ( b , a % b ); } else { return gcd ( b , a ); } } int LCM ( int a , int b ) { if ( a = b ) { int i ; for ( i = 1
using namespace std;
int gcd(int a,int b)
{
if(a>=b)
{
if(a%b==0)
return b;
else
return gcd(b,a%b);
}
else
{
return gcd(b,a);
}
}
int LCM(int a,int b)
{
if(a>=b)
{
int i;
for(i = 1;(a*i)%b!=0;i++);
return a*i;
}
else
{
return LCM(b,a);
}
}
int main()
{
cout << gcd(15,5) << endl;
cout << LCM(20,10);
}