Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1.  
  2. public class EX1 {
  3.  
  4.     public static void main(String[] args) {
  5.         // TODO Auto-generated method stub
  6.         for (int i=1; i<=110; i++)
  7.         {
  8.             if(i%12==0)
  9.                 System.out.println();
  10.                     if(i%3==0)
  11.                         System.out.print("Boom ");
  12.                     else if (i%5==0)
  13.                         System.out.print("Bam ");          
  14.                         else if (i%7==0)
  15.                             System.out.print("Bim ");
  16.                             else if (i%15==0)
  17.                                 System.out.print("BoomBam ");
  18.                                 else if (i%21==0)
  19.                                     System.out.print("BoomBim ");
  20.                                     else if (i%35==0)
  21.                                         System.out.print("BamBim ");       
  22.                                         else if (i%105==0)
  23.                                             System.out.print("BoonBamBim ");
  24.                                         else
  25.                                             System.out.print(i + " ");
  26.         }          
  27.     }          
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement