Homework 3

Due on Thursday March 31 before midnight


This homework must be done individually. No copying is permitted.

  1. (40 points) Consider the following C program:
    int fun (int* i) {
      *i += 5;
      return 5;
    void main () {
      int x = 3;
      x = x + fun(&x);
    What is the value of x after the assignment statement in main, assuming
    1. operands are evaluated left to right.
    2. operands are evaluated right to left.

  2. (20 points) Problem 7.14 in the textbook (p301).

  3. (20 points) Problem 7.21 in the textbook (p302).

  4. (20 points) Problem 7.22 in the textbook (p302).

What to Submit

Use the form below to submit your homework. We do not accept email or hardcopy submissions. Acceptable file formats for your submitted file are: plain text, Microsoft Word document (.doc), PDF (.pdf), and postscript (.ps). Don't forget to put your name and student ID on your homework. You may submit your file as many times as you like, but only the most recently submitted file will be retained and evaluated.

Submit Homework #3:

Last modified: 03/24/11 by Leonidas Fegaras