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


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

599


What are the advantages and disadvantages of a heap?

700


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

1888


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

663


What is a node in c?

543






Write a program to reverse a given number in c language?

616


Can we use any name in place of argv and argc as command line arguments?

606


When would you use a pointer to a function?

583


What is data structure in c and its types?

589


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

651


What is #include stdio h?

678


explain what are pointers?

615


why wipro wase

1823


What is the difference between the local variable and global variable in c?

526


What is the use of printf() and scanf() functions?

628