gulzaar

nLCM

Mar 1st, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. /**
  2.  *
  3.  */
  4.  
  5. /**
  6.  * @author Ravinesh
  7.  *
  8.  */
  9. public class que6_LCM {
  10.  
  11.     /**
  12.      * @param args
  13.      */
  14.     public static void main(String[] args) {
  15.         // TODO Auto-generated method stub
  16.    
  17.    
  18.        
  19.     for (int i = 0; i <= 100; i++) {
  20.         if ( i % 12 == 0
  21.                 && i % 15 == 0
  22.                 && i % 20 == 0
  23.                 && i % 27 == 0) {
  24.             System.out.println(i);
  25.             }
  26.         else {
  27.             System.out.println("There is no such number divisible by 12,15,20,27");
  28.             }
  29.         }
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment