CSE 305 Programming Languages Fall, 2003 Professor Shapiro Homework 4 Maximum Points: 17 Due 9:00 am, Thursday, October 2, 2003 Copy this file to a text file named hw4.txt, edit into it your answers, and submit the file via the submit program by the deadline given above. 1. (6) Do both parts (a) and (b) of problem 8 of Chapter 5 of the text. 2. (10) Do problem 12 of Chapter 5 of the text. 3. (1) The following C program is an infinite loop. Will it terminate when it runs out of stack space or when it runs out of heap space? #include int fact(int x) { if (x == 0) return 1; else return x * fact(x-1); } int main() { int y = -1; printf("factorial(%d) = %d\n", y, fact(y)); return 0; }