Give a fast way to multiply a number by 7
Answer Posted / rajan
ANU is right the answer is x<<3 -x
when you left shift any number by 1 it is equivalent to
multiplying with 2.
so, left shift by 3 means ur are multiplying with 8.
and x*7 = x(8-1) = x*8-x = x<<3-x .
| Is This Answer Correct ? | 31 Yes | 5 No |
Post New Answer View All Answers
What is a pragma?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Explain how do you use a pointer to a function?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What is the size of a union variable?
What are the advantages of using Unions?
When should structures be passed by values or by references?
What is #pragma statements?
Explain what is the advantage of a random access file?
How do shell structures work?
How can I use a preprocessorif expression to ?
What is the difference between the = symbol and == symbol?
c program for searching a student details among 10 student details
Which one would you prefer - a macro or a function?
Why is it usually a bad idea to use gets()? Suggest a workaround.