Table of Contents

DTR0

Within dtr0.c you will find multiple sections, commented respective to their task. You will write very similar code for the required sections, each section meant for a different data type in C (and titled appropriately). As an example of the code you'll need, all the tasks for signed char have already been completed. It is your job to study the given code and implement it elsewhere in the program where appropriate to create sections for each data type, which will be formatted and printed to the terminal.

These sections will contain multiple print statements to display information and formatting. They will also contain some computations for determining some of the information that will be printed to the screen. For example, take the following statement:

quantity = (long double) pow (2, (size * 8)); 

This statement informs us of the possible distinct values, which we will need for our output.

To get an idea of what your output should look like for each section, you can compile and run the program before even making any modifications. Notice that there is formatting to align the information in the right “column”. There are seven values paired with their respective textual descriptions to the left. Some of these values are dynamic and computed by our code, and some of these values are static or hard-coded.

REPOSITORY STEPS

BUILD THE CODE

RUN THE PROGRAM

BACKGROUND

INTEGER VALUES

REPRESENTATION: BASE 2 (BINARY)

REPRESENTATION: BASE 16 (HEXADECIMAL)

STORAGE: BITS AND BYTES

BITWISE LOGIC: AND

BITWISE LOGIC: OR

BITWISE LOGIC: XOR

BITWISE LOGIC: NOT