/* Listing 1 */ int n, x; n = 3; x = rand() % n; return x;