PS 1

  1. What value does a variable store if you declare it without assigning a value to it: we write int a for example and then print out a; what about doubles, floats and chars.
  2. If you take a double from an unsigned int does it cast to a double or a short int?
  3. Write a short programme that cin's a double and prints out the decimal part.
  4. ceil(a) rounds a up and floor(a) rounds it down, write a programme that cin's a double and then rounds it the way we do, up if it the decimal is greater than 0.5 and down otherwise.