How to know what's going to compile in this situation? : I have this problem in particular which I don't know why is 30 the answer,
 

       int h(int x) {
     if (x < 1) {
      return 0;
       } else {
      return x + h(x - 1);
       }
     }

     int main() {
      cout << 2 * h(5);
            return 0;
      }

30, is the result, but I don't know why.

