Given a two number ,we need to find the lcm of two number .and print their resultant value.

So what is **LCM** of number?

LCM of two number is smallest number that divides both the number.

**Example:**

```
input:15 and 25
ouput:75
```

**Logic:**

`we just need to find the smallest number that divides both the number.`

**Code-**

#include<bits/stdc++.h> using namespace std; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int lcm(int a, int b) { return (a / gcd(a, b)) * b; } int main() { int a=15; int b=25; int k; k=lcm(a,b); cout<<k<<endl; }

**Output:**

75

**Time complexity**:0(N)

**Space Complexity**:O(1)