Give a fast way to multiply a number by 7
Answer Posted / pratik chopra
It is very obvious above condition will not work if output
after multiplying by 7 is not 8 bit. In that case, if you
consider 64*7=448 which is 111000000 and a 9bit number.
Thus, there is an overflow. Even a normal decimal
calculation, restricted to 8 bit will not give a right answer.
In other words, any n-bit number whose multiplication with 7
is an n-bit number, the above solution will work otherwise,
overflow will occur.
For 8 bit no. max x<=(255/7)<=36.
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is c method?
How can a program be made to print the name of a source file where an error occurs?
Explain the use of keyword 'register' with respect to variables.
What is the correct declaration of main?
Why is not a pointer null after calling free?
Differentiate between a for loop and a while loop? What are it uses?
What are the rules for the identifier?
The statement, int(*x[]) () what does in indicate?
Explain how can you be sure that a program follows the ansi c standard?
Should I learn data structures in c or python?
Explain what is the heap?
What is define c?
When is the “void” keyword used in a function?
What is the difference between typedef struct and struct?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion