Question 4: show the function call sequence [7.5]

(a) For the program shown below, show the sequence of function calls that are made (in the order they are made) and the value of each parameter in the call.
(b) Show the output produced by the program.
#include <cstdio>
#include <cctype>

int f1(int &a, int &b);
char f2(int c);
void f3(int d, char e);

int main()
{
   int w, x, y;
   char z;
   w = 10;
   x = 5;
   y = f1(w, x);
   z = f2(y);
   f3(x, z);
}

int f1(int &a, int &b)
{
   a = a + b;
   b = a - b;
   return (a - b);
}

char f2(int c)
{
   if (c < 0) {
      return '-';
   } else if (c == 0) {
      return '0';
   } else if (c == 1) {
      return '1';
   } else if ((c % 2) == 0) {
      return 'e';
   } else {
      return 'o';
   }
}

void f3(int d, char e)
{
   if (isdigit(e)) {
      printf("%c\n", e);
   } else {
      printf("%d\n", d);
   }
}

SAMPLE SOLUTION
the first call is
   f1(10,5)
      inside f1, the value of a(w) gets changed to 15,
                the value of b(x) gets changed to 10,
      f1 returns 5, which is stored in y
the second call is then
   f2(5)
      inside f2, c is 5, which is not negative,
                not 0, and not even, so the "else"
                case runs, returning 'o' 
                (the lowercase letter o)
      thus f2 returns 'o', which is stored in z
the third call is thus
   f3(10, 'o')
      inside f3, the 'o' is not a digit,
             so the else case runs,
             printing the 10
note that technically the fourth function call is
   printf("%d\n", 10)

the output produced is simply
10