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


Please Help Members By Posting Answers For Below Questions

What are the types of type specifiers?

625


What is a far pointer in c?

599


If the size of int data type is two bytes, what is the range of signed int data type?

596


How do you generate random numbers in C?

663


Why should I prototype a function?

644






Why do we need a structure?

593


What is pass by reference in functions?

327


How a string is stored in c?

592


Tell me with an example the self-referential structure?

568


What is sizeof int in c?

606


What is function prototype in c language?

619


What is volatile variable in c?

660


Is it acceptable to declare/define a variable in a c header?

688


Does c have class?

615


Compare interpreters and compilers.

642