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
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are the advantages and disadvantages of a heap?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What is a node in c?
Write a program to reverse a given number in c language?
Can we use any name in place of argv and argc as command line arguments?
When would you use a pointer to a function?
What is data structure in c and its types?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is #include stdio h?
explain what are pointers?
why wipro wase
What is the difference between the local variable and global variable in c?
What is the use of printf() and scanf() functions?