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
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
Is using exit() the same as using return?
Do you know null pointer?
What are integer variable, floating-point variable and character variable?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
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'); }
What is huge pointer in c?
What is structure in c explain with example?
Is c call by value?
Explain union.
What is the difference between local variable and global variable in c?
Can a variable be both constant and volatile?
How can you avoid including a header more than once?
c program to compute AREA under integral