employer cover photo
employer logo
employer logo

Backstop Solutions

Is this your company?

Backstop Solutions Interview Question

implement an algorithm to print if a number is divisible by 3 without using division or modulo

Interview Answers

Anonymous

Mar 4, 2016

int num = 25; int x = 3; int counter = 1; if(num = num) { break; } else { x = 3*counter; counter++; } } if(x>num) { System.out.println("Number "+num+" is NOT divisible by 3"); } else if (x == num) { System.out.println("Number "+num+" is divisible by 3"); } }

Anonymous

Mar 4, 2016

int num = 25; int x = 3; int counter = 1; if(num = num) { break; } else { x = 3*counter; counter++; } } if(x>num) { System.out.println("Number "+num+" is NOT divisible by 3"); } else if (x == num) { System.out.println("Number "+num+" is divisible by 3"); } }