Program to find the LCM of two prime numbers | C ++ Program to find LCM of two prime numbers ; Function to return the LCM of two prime numbers ; If the two numbers are equal then return any one of a and b ; Else return product of numbers ; Driver code ; Given two numbers ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; int findLCMPrime ( int a , int b ) { if ( a == b ) { return a ; } return a * b ; } int main ( ) { int a = 3 , b = 5 ; cout << findLCMPrime ( a , b ) ; return 0 ; }