Give a fast way to multiply a number by 7
Answer Posted / pratik chopra
Yes this can be made generic;
Approach: 7*x=(8-1)*x= 8*x-1*x=x<<3-x
If 6*x=(4+2)x=4*x+2*x=x<<2+x<<1
If 13*x=(16-2-1)x=(x<<4-x<<1-x)
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What are the types of type specifiers?
What is a far pointer in c?
If the size of int data type is two bytes, what is the range of signed int data type?
How do you generate random numbers in C?
Why should I prototype a function?
Why do we need a structure?
What is pass by reference in functions?
How a string is stored in c?
Tell me with an example the self-referential structure?
What is sizeof int in c?
What is function prototype in c language?
What is volatile variable in c?
Is it acceptable to declare/define a variable in a c header?
Does c have class?
Compare interpreters and compilers.