Monday 25 July 2022

Chapter 25 // Exercise 3 - Principles & Practice Using C++

In this exercise I am using Visual Studio 2019 and a modified version of the std_lib_facilities header found here.

Chapter 25 // Exercise 3

Initialise a 32-bit signed integer with the bit patterns and print the result: 
- all zeros, 
- all ones,
- alternating ones and zeros (starting with a leftmost zero), 
- alternating zeros and ones (starting with a leftmost one),
- the 110011001100...pattern, 
- the 001100110011...pattern, 
- the pattern of all-one bytes and all-zero bytes starting with an all-one byte, 
- the pattern of all-one bytes and all-zero bytes starting with an all-zero byte. 
Repeat that exercise with a 32-bit unsigned integer.

.

2 comments:

  1. Hi! I appreciate so much what you do! I love genuine people sharing knowledge and personal experience online, on any topic. Keep on!

    A question: I noticed you're already an employed software engineer, so did you finish the book before being hired?

    ReplyDelete
    Replies
    1. Thank you! And I am yet to still finish this bloody book lol. Only a few more chapters to go but life often gets in the way now and it's difficult to find time to program outside of work. I got to about Chapter 9 I think when I got my current job.

      Delete