Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Fizzbuzz{
- public static void main(String args[]){
- String output="";
- for(int i=1; i<=100; i++){
- output="";
- if (i%3==0) output+="fizz";
- if (i%5==0) output+="buzz";
- if (output.equals("")) output+=i;
- System.out.println(output);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement