Give a fast way to multiply a number by 7
Answer Posted / rupesh
There is a problem with
x=(x<<3)-x;
Suppose that x is stored in 8 bit format.
If x = 64, i.e. 2^6, then this won't work.
In general, if x is n-bit, and value of x > 2^(n-3), then
this won't work.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain what is the benefit of using #define to declare a constant?
How important is structure in life?
Is c programming hard?
What is the difference between array_name and &array_name?
Describe newline escape sequence with a sample program?
Why we use break in c?
State the difference between x3 and x[3].
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
Why is c still so popular?
What is the newline escape sequence?
Can true be a variable name in c?
p*=(++q)++*--p when p=q=1 while(q<=6)
What are different types of pointers?
When is a void pointer used?