Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Give a fast way to multiply a number by 7

Answer Posted / anonymous

The easiest way is to relate the number to be multiplied
by, to a power of 2. Then a corresponding number of left
shifts to that power with an addition or subtraction would
give the desired result.

In this case, 7 can be written as 2^3 - 1 or 8 - 1.
Therefore, shift the number to the left thrice which would
multiply it by 8. Then subtract the original. You can also
do this as

4 + 2 + 1 = 2^2 + 2^1 + 1

Is This Answer Correct ?    20 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between new and malloc functions?

1138


What are two dimensional arrays alternatively called as?

1192


What is include directive in c?

1169


Are there any problems with performing mathematical operations on different variable types?

1047


differentiate built-in functions and user – defined functions.

1101


Does c have class?

1127


What is spark map function?

1147


Write a code to generate a series where the next element is the sum of last k terms.

1234


What is calloc malloc realloc in c?

1067


Is multithreading possible in c?

1023


What is pointer in c?

1206


What does c mean in basketball?

1002


Write a C program in Fibonacci series.

1098


How is a macro different from a function?

1196


How to draw the flowchart for structure programs?

9348