Skip to Main Content
Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
book

Xpress Learning - Computer Fundamentals of Programming an IT by Pearson

by Ashok N. Kamthane, Rohit Khurana
May 2024
Beginner to intermediate content levelBeginner to intermediate
465 pages
16h 14m
English
Pearson India
Content preview from Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
II-50 Programming Concepts
The syntax of shift left operator is as follows:
Variable << number of bits to shift left. 
The difference between shift right and shift left operator is as follows:
1. The shift right operator is used to divide the number by 2.
2. The shift left operator is used to multiply the number by 2.
Example:
Value of i Execution of Each Statement Final Value of i
i = 4 00000100 4
I =i<<1 00001000 8
i =i >> 1 00000010 2
i = i >> 2 00000001 1
32.   Which  binary  shifting  is  equivalent to  multiplying  an  unsigned number by  2:  right 
shifting by 1 or left sifting by 1?
Ans: Multiplying an unsigned number by 2 is equivalent to
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Express Learning - Computer Fundamentals and Programming

Express Learning - Computer Fundamentals and Programming

Ashok Kamthane, ITL ESL
Windows® Internals, Sixth Edition, Part 2

Windows® Internals, Sixth Edition, Part 2

David A. Solomon Mark E. Russinovich and Alex Ionescu

Publisher Resources

ISBN: 9781299954878