Skip to content

Instantly share code, notes, and snippets.

@afiqiqmal
Created November 1, 2017 17:14
Show Gist options
  • Save afiqiqmal/76df37a8424c58d94754330ee83fae12 to your computer and use it in GitHub Desktop.
Save afiqiqmal/76df37a8424c58d94754330ee83fae12 to your computer and use it in GitHub Desktop.
FizzBuzz Problem
public static void main(String[] args){
for(int x=1;x<=100;x++){
if(x%3==0){
System.out.print("Fizz");
if(x%5==0){
System.out.print("Buzz");
}
System.out.println();
}
else if(x%5==0)
System.out.println("Buzz");
else
System.out.println(x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment