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

In C language what is a 'dangling pointer'?

632


Explain what is the difference between far and near ?

649


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1176


write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.

3331


What is a scope resolution operator in c?

745






Do string constants represent numerical values?

913


What is #include called?

565


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1535


How will you find a duplicate number in a array without negating the nos ?

1637


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1124


What is an identifier?

618


What are the different types of control structures in programming?

656


How was c created?

586


What is a structure and why it is used?

615


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1718