Computer Programming - final exam

The written exam has 2 parts:
  1. a set of short review questions
  2. a set ofprogramming exercises

Examples of short review questions

What is the output of the following program sequence ? (... given a program ...)

Identify and explain the errors in the following program sequence ( ... given a program sequence ...)

Suppose we have the declarations

char *pc;
char *str="ciao!"
pc=&str[2];
What does the expression *--pc mean, and how is it different from --*pc?

Examples of programming exercises

Write a recursive function that takes an int as argument and displays it in binary form.

Write a program to remove all comments from a C program. Comments are characters included between /* and */ or between // and end of line. The characters /* , */ and // can also occurs inside string constants, but then they have to be disregarded by the program !

Some samples of old exam questions

Subjects A - part I, A - part II, B - part I , B - part II