Numbers

  1. What does sizeof do? What does sizeof(int) return? What does sizeof(short) return?
    How many bytes is that? How many bits?
  2. How many bits in a byte?
  3. How many bytes in 1 kb?
  4. What are hex numbers preceeded by?
  5. What are octal numbers preceeded by?
  6. What happens when you try to store a number that's too big to fit in the data type? What do we call this problem? Does the C compiler give an error message to help you debug it?
  7. What is the purpose of an unsigned int? Why use that?
  8. What is Oct 31 in Decimal? =)
  9. How does the -Wall option when compiling help you?
  10. What happens if you print using %d and the value you send is a floating point (e.g. 3.14)?
  11. What happens if you print using %d and the value you send is a character (e.g. 'A' );
  12. What happens if you print using %c and the value you send is an int (e.g. 65 );
  13. If the decimal number 420 is 0x1a4 in hex, and decimal-to-binary 420 is 110100100, what is the hex number 0x1a4 in binary?
  14. Hex numbers are easy to convert to binary: show how with the number 0x95F