Praise Mimiru!

Jun 26, 2003 09:59

rathermercurial posted on 2003-06-25 08:10:Mimiru!!!
I got my present!!! I will hang her on the wall of my new bedroom (where else would I want to look at Mimiru?). Hee!

^_^ I enjoy spreading happiness. Refer to Dominant Destruction.

More homework to complete and I have a quiz today in class. We're getting tested on Homeworks 1 - 7 and up to Section 2.1 in the book that I don't own yet. Isn't summer school grand!? The homework today kinda looks like this:

Consider the following code:
unsigned short x=10;
cin >> x; // Input a number into x
bool b3;
bool b2;
bool b1;
bool b0;

b0 = x & 1; // this is a BITWISE-AND (n^0)
b1 = x & 2; // n^1
b2 = x & 4;
b3 = x & 8;

printf("%d in binary is = %d%d%d%d\t\n", x, b3, b2, b1, b0);

You enter a number, it spits out the binary equvalant. We then have to make it work for all 16 bits of binary (n to the 15th, or bF = x & 32768;). The biggest number it can handle: 65535 in binary is 1111 1111 1111 1111.
Previous post Next post
Up