Bits and Binary operators program

This program is based off of the recent topics discussed in our OOP344 class about bits and binary operators.  I used the bits function made by our teacher last class.  This program asks the user for a hexadecimal integer and gives the option to left shift, right shift, reverse it, and also compare it with another hexadecimal integer, using the &, | and ^ operators.  It also displays the bits in sets of fours.

Since there is a difference with signed integers when it is right shifted, I put a signed version of the program that can be used by commenting out the unsigned #define version at the top of the program.

I posted it in a public repository on GitHub:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s