Cascaded function call question

I‘m not quite sure where you have a problem… if you have to do it on pen and paper, just replace the variable name a with the variable you are testing for.

So for 2.3 it would just look like this :

int chi (47) {
   int b = foo(47) = 47%10 = 7
   if (7 < 5) {
      return 47 - 7 = 40;
   } else {
      return 47 - 7 + 10 = 50; // this one will be returned
   }
}

I have to say, this i very Basic Math (3rd elementary at most) and the most basic principle of programming (knowing that variables have values and that functions are evaluated right when they are called before going on to the next line and knowing how return works)…