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

writ a program to compare using strcmp VIVA and viva with its output.

2083


Explain what are linked list?

1092


Explain how do you print only part of a string?

1280


Why & is used in c?

1247


What is an auto variable in c?

1294


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1855


How can my program discover the complete pathname to the executable from which it was invoked?

1119


What is the difference between array and pointer in c?

1230


How do you search data in a data file using random access method?

1360


Which header file should you include if you are to develop a function which can accept variable number of arguments?

1463


Why is struct padding needed?

1158


write a programming in c to find the sum of all elements in an array through function.

2221


What are the 4 data types?

1059


what is the different bitween abap and abap-hr?

2426


Which is the best website to learn c programming?

1135