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


Please Help Members By Posting Answers For Below Questions

which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2416


any "C" function by default returns an a) int value b) float value c) char value d) a & b

671


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

1633


What is a const pointer?

640


hi send me sample aptitude papers of cts?

1656






What are the benefits of c language?

651


What is bubble sort in c?

640


What is the explanation for cyclic nature of data types in c?

652


What are disadvantages of C language.

652


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

768


What are the different types of errors?

648


What is the difference between array and structure in c?

573


Why is sizeof () an operator and not a function?

593


What is line in c preprocessor?

618


What are dangling pointers in c?

650