Guest User

Untitled

a guest
Jun 24th, 2010
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. public class FizzBuzz
  2. {
  3.     public static void main(String [] args)
  4.     {        
  5.         for (int i = 1; i <= 100; i++)
  6.         {
  7.             String output = Integer.toString(i);
  8.             output += (i % 3 == 0 ? " Fizz" : "") + (i % 5 == 0 ? " Buzz" : "");
  9.             System.out.println(output);
  10.         }
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment