Handout - Data types and Expressions

Given the following declarations, determine the value of the variable on the left-hand-side of each assignment statement.

  int    int1, int2, int3;
  float  f1=1.0, f2=2.5, f3=5.0;
  double d1, d2;
  char   ch1, ch2;

  int1  = 5;
  d2    = 5.0;
  ch1 = '5';


  int3  = f2;
  int2  = int1 / int3;


  d1    = f3 - -f1 * 6 / int3 + 8.0 * (int1 - d2);


  ch2 = ch1 - 2;
  int3  = 'a' - 'A';
  ch1 = 'W' + int3;