[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: C
Home > Technical Interview Q&A > C > Discussion

24 / 123

What is equivalent of multiplying an unsigned int by 2: left shift of number by 1 or right shift of number by 1?

Answer:

multiplying a number by two is equivalent to bitwise left shift of a number by 1 for eg

1 has a binary representation as 00001 left shift by 1 will make it 00010 which is 2.

right shift is equivalent to divide a number by 2 .

left shift is equivalent to multiply a number by 2.

Asked In ::

Post Your Answer Here:


Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.