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
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
any "C" function by default returns an a) int value b) float value c) char value d) a & b
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What is a const pointer?
hi send me sample aptitude papers of cts?
What are the benefits of c language?
What is bubble sort in c?
What is the explanation for cyclic nature of data types in c?
What are disadvantages of C language.
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
What are the different types of errors?
What is the difference between array and structure in c?
Why is sizeof () an operator and not a function?
What is line in c preprocessor?
What are dangling pointers in c?