FizzBuzz implementation in Java without modulus operator I was trying to implement FizzBuzz without modulus operator.

Areas of concern: inner for loop maybe not needed? seq[] array maybe not needed?

class FizzBuzzWithoutModulus{
    public static void main(String[] args){

    int[] fizzbuzz = new int[101];
    int[] buzz = new int[101];
    int[] fizz = new int[101];

    int[] seq = new int[101];
    for(int i=1; i&lt;=100; i++){
      seq[i] = i;
    }

    for(int i=1; i&lt;=100; i++){
      for(int j=1; j&lt;seq.length; j++){
        if((i/15.0) == seq[j]){
          fizzbuzz[i] = i;
        }
        else if((i/5.0) == seq[j]){
          buzz[i] = i;
        }
        else if((i/3.0) == seq[j]){
          fizz[i] = i;
        }
      }
    }
    for(int i=0; i&lt;=100; i++){
      if(fizzbuzz[i]!=0){
        System.out.println(fizzbuzz[i] + " fizzbuzz");
      }
      else if(buzz[i]!=0){
        System.out.println(buzz[i] + " buzz");
      }
      else if(fizz[i]!=0){
        System.out.println(fizz[i] + " fizz");
      }
    }
  }
}
I think this implementation is really too confusion for the problem at hand, although I think it is quite an interesting solution. 

As you said it yourself, integer division loses the fractional part (rounds down towards 0). You can actually use this for your solution! Because if a number is not evenly divisible, multiplying with the division result will not give you back the original number, it will be smaller! 

So a way to do this would be:

public static String fizzBuzz(final int number) {
    if (number / 15 * 15 == number) {
        return "FizzBuzz";
    } else if (number / 5 * 5 == number) {
        return "Buzz";
    } else if (number / 3 * 3 == number) {
        return "Fizz";
    }
    return Integer.toString(i);
}


Note that a number divisible by 3 and 5 is also divisible by 15.