79759170

Date: 2025-09-08 17:06:44
Score: 1
Natty:
Report link
 public class LCM
{   
    int n1,n2;//input values from user,i.e the values who's LCM is to be found
    int large,sm;//compare n1 and n2. Store the larger number in large and smaller number in sm

   public int getLCM()
   {     
      if(large!=sm) 
      {   
          if (large>sm)  
          large=large-sm;  
          else if (large<sm)  
          sm=sm-large; 

       return getLCM(); 
      } 
     else 
     return (n1*n2)/large; 
   }
}
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Karthik