Thought it was weird that the OP didn't do one, so here I go.
package fizzbuzz;
public class FizzBuzz {
static void FizzBuzz(int a) {
if (a%3==0) {
if(a%5==0) {
System.out.println("FizzBuzz");
}
else {
System.out.println("Fizz");
}
}
else if(a%5==0) {
if(a%3==0) {
System.out.println("FizzBuzz");
}
else {
System.out.println("Buzz");
}
}
else {
System.out.println(a);
}
}
public static void main(String[] args) {
for(int i=1;i<=100;i++) {
FizzBuzz(i);
}
}
}I know it's redundant to make a new function just to do the math, but I did it for fun ;-;