The FizzBuzz challenge, I’m having trouble removing the numbers. I can get Fizz, Buzz and FizzBuzz when I run the code but the numbers aren’t removed from the output. Can anyone at least point me in the right direction?
Here is my code:
class FizzBuzz{
public static void main(Stringargs){
for (int i = 1; i <= 100; i++){
if (i % 3 == 0 && i % 5 == 0){
System.out.println(“FizzBuzz”);
}
else (i % 3 == 0){
System.out.println("Fizz");
}
else (i % 5 == 0){
System.out.println("Buzz");
}
System.out.println(i);
}
}
}
Any help would be appreciated. I’ve been stumped on this off and on for this past week.