Domanda di colloquio di Fast Enterprises

Write a program to multiply/divide without using multiplications/division symbols

Risposta di colloquio

Anonimo

23 mag 2019

int multiply(int a, int b) { int product = 0; boolean neg = false; if(b = 0 ) { num = num - den; quotient++; } if(neg == 1) //odd number of negative sign, quotient must be negative return (0 - quotient); return quotient; }