Program to find the LCM of two prime numbers | Java 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
class GFG { static int findLCMPrime ( int a , int b ) { if ( a == b ) { return a ; } return a * b ; } public static void main ( String [ ] args ) { int a = 3 , b = 5 ; System . out . println ( findLCMPrime ( a , b ) ) ; } }