Why this code is not working

#include
using namespace std;
typedef long long ll;
ll lcm(ll a,ll b)
{
ll gcd=(b==0?a:lcm(b,a%b));
ll alcm=(a*b)/gcd;
return alcm;
}
int main() {
ll N1,N2;
cin>>N1>>N2;
cout<<lcm(N1,N2);
return 0;
}

@guptanikhil898
You first have to calculate gcd and then do a*b/gcd;
you need to separate the gcd function. and then do that.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.