Answer
Multiply by 8 via shift and substract the number:
int multiply(int num)
{
return (num << 3) - num;
}
...
Search results for shift
How to fast multiply a number by 7?
Posted by CMasterStack and Queue interview questions
Posted by CMaster
Stack and Query structures in computing are extremely fundamental and important. Then interviewing I expect candidate to fully understand this data s ...
The task is to divide a number by 7 efficiently without using {/, *, -} operators.
Possible Solution:
The solution is to realize that we can do thi ...
Possible Solution:
Bitwise operations are very efficient and unexpressive, and doubling a number is a simple shift to the left i.e adding a zero on ...
Give me a specific example of a time when you used good judgment and logic in solving a problem.
Posted by CommonInterview
Strategy Statement:
How important is good judgement and logic in how you handle yourself in the workplace? Are you someone that applies independent r ...
Answer:
int Double(int Number)
{
return (Number >> 1);
}
Note that the fractional part is rounded down.
...
24/7 operations are like relay races where you take the baton, run with it and then pass it on smoothly. How do you make seamless transitions on shift ...
Use the Shift key and/or Control key to select multiple objects. To select all objects in a GUI map file, choose Edit > Select All.
[Source: JAGAN M ...
