Find big from leas common multiple

Program:-

package forloop;

public class BLCM {

	public static void main(String[] args) {
      int no1=4;
      int no2=15;
      int big = no1>no2?no1:no2;
      int temp = big;
      for(temp=big; true; temp++ )
      {
    	  
    	  if(temp%no1==0 && temp%no2==0) 
    	  {
    		  System.out.println(temp);
    		  break;
    	  } 
    	 
      }
	}

}

Output Screenshot:-

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free