#include
using namespace std;
int gcd(int a,int b)
{
if(b==0)
{
return a;
}
else
{
return gcd(b,a%b);
}
}
int main() {
int n1,n2;
cin>>n1,n2;
int gcd1=gcd(n1,n2);
int lcm=(n1*n2)/gcd1;
cout << lcm <<endl;
return 0;
}
#include
using namespace std;
int gcd(int a,int b)
{
if(b==0)
{
return a;
}
else
{
return gcd(b,a%b);
}
}
int main() {
int n1,n2;
cin>>n1,n2;
int gcd1=gcd(n1,n2);
int lcm=(n1*n2)/gcd1;
cout << lcm <<endl;
return 0;
}
@muditak14
Include the iostream library and take the inputs correctly. It should be cin >> n1 >> n2 in place of what you have written.
If my answer was able to resolve your query, please mark the doubt as resolved.