Created
November 1, 2017 17:14
-
-
Save afiqiqmal/76df37a8424c58d94754330ee83fae12 to your computer and use it in GitHub Desktop.
FizzBuzz Problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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