Find the other number when LCM and HCF given | Java program to find other number from given HCF and LCM ; Function that will calculates the zeroes at the end ; Driver code ; Calling function .
class GFG { static int otherNumber ( int A , int Lcm , int Hcf ) { return ( Lcm * Hcf ) / A ; } public static void main ( String args [ ] ) { int A = 8 , Lcm = 8 , Hcf = 1 ; int result = otherNumber ( A , Lcm , Hcf ) ; System . out . println ( " B ▁ = ▁ " + result ) ; } }