public static int divide(int dividend, int divisor) {

int answer = 0;

int new_dividend = dividend;

while(true){

new_dividend = Math.abs(dividend) - Math.abs(divisor);

if(new_dividend>=0){

answer++;

}

else{

if(dividend > 0 && divisor<0 )

return 0-answer;

else{

return answer;

}

}

```
}
}
```