Pergunta de entrevista da empresa Apryse

How to multiply a number by 7 without using + and * operators?

Respostas da entrevista

Sigiloso

14 de out. de 2010

use bit shifting.

1

Sigiloso

23 de jan. de 2013

n=n<<3-n

1

Sigiloso

9 de ago. de 2013

do the left.bit shift operation by 3 and then subtract the result by original number . eg: n=1 ,then n=n<<3 -n gives 7 , if n=2 ,then gives 14