#include<iostream>
using namespace std;
int anik(int n, int m)
{
static int j = n;
if(j%n == 0 && j%m == 0)
return j;
else
{
j++;
return anik(n, m);
}
}
int main()
{
int a, b;
cout << "Enter Two Number :: ";
cin >> a >> b;
cout << endl;
if(a < b)
swap(a, b);
cout << "LCM is :: " << anik(a, b) << endl;
return 0;
}
using namespace std;
int anik(int n, int m)
{
static int j = n;
if(j%n == 0 && j%m == 0)
return j;
else
{
j++;
return anik(n, m);
}
}
int main()
{
int a, b;
cout << "Enter Two Number :: ";
cin >> a >> b;
cout << endl;
if(a < b)
swap(a, b);
cout << "LCM is :: " << anik(a, b) << endl;
return 0;
}
Comments
Post a Comment