Answers for "lcm function c++"

C++
1

lcm function c++

ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}
Posted by: Guest on September-19-2021
-1

lcm in c++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    cout << 3*5/__gcd(3, 5) << endl;//15
    return 0;
}
Posted by: Guest on April-08-2021

Browse Popular Code Answers by Language