Lab: a little data representation, part 2

Here's a list of questions. For each question, show how to answer the question by writing a little C code.

1. Integers

2. A handy tool

If you want to know the exact bits contained in an int, do this:

int j = whatever; printf("0x%08X\n", j);

It gets slightly weirder for long (note the l before the X)

long k = whatever; printf("0x%016lX\n", k);

It gets even weirder for char. See below.

2. Some questions