Pregunta de entrevista de Apryse

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

Respuestas de entrevistas

Anónimo

14 oct 2010

use bit shifting.

1

Anónimo

23 ene 2013

n=n<<3-n

1

Anónimo

9 ago 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