CS 150 Introduction to C++ Programming - Spring 1998 

[ Home | Lecture Notes| WebTutor | WebTutor Site Map]


C++ Syntax and Semantics

Evaluating Expressions


4. if x and y are integers and x = 5 and y = 8, what is the value of x after each statement is evaluated?
(evaluate each statement independently) Type your answer in the box provided. (from exercise 6. p 89)

  1. x = 2 * y;

  2. x = x + y;

  3. x++;

  4. x = x / y;

  5. x--;

  6. x = x + x;

  7. x = y % 6;

 

Choose one when done
   

Copyright chris wild 1998.
For problems or questions regarding this web contact [Dr. Wild (e-mail:wild@cs.odu.edu].
Last updated: February 22, 1998.