Sollicitatievraag bij BlackBerry

Write a function that will return x*7 without using multiplication?

Antwoorden op sollicitatievragen

Anoniem

26 jan 2012

You could either do this by macro or inline (it usually would be inlined). inline int mulby7(int x) { return (x << 3) - x; }

1

Anoniem

17 jan 2012

int func(int x) { return (x<3)-x; }