Blog # 53 : How to multiply by 7?
Give a fast method to multiply a number by 7.
Click here to see the solution. p.s. - For Remarks please hit the given link once. For Hint, hit it twice and for the solution, hit it thrice. Courtesy: Vibhaj |
Give a fast method to multiply a number by 7.
Click here to see the solution. p.s. - For Remarks please hit the given link once. For Hint, hit it twice and for the solution, hit it thrice. Courtesy: Vibhaj
|
Tech World: Blog # 53 : How to multiply by 7? - Blog # 53 : How to multiply by 7?
n*7=(n*8)-n.
To perform multiplication by 8, we can do
n*8=n<<3.
So, we have
n*7 = (n<<3)- n.
@Ankit: Correct