Created
January 22, 2011 17:18
-
-
Save tenkoma/791269 to your computer and use it in GitHub Desktop.
FizzBuzz Program written in Java
This file contains 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
class F{ | |
public static void main(String[] a){ | |
for(int i=1;i<101;i++){ | |
String s=""; | |
if(i%3==0)s+="Fizz"; | |
if(i%5==0)s+="Buzz"; | |
if(s=="")s=String.valueOf(i); | |
System.out.println(s); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment