title: Multiple functions in C++
body: <p>Today I was trying to do recursion with multiple functions and I was using some function and in that I was using a function which is declared below it </p>
  
  <p>Here is my code : </p>
  
  <pre><code>#include&lt;bits/stdc++.h&gt;
  using namespace std;
  #define MOD 10
  
  int f(int x){
      if(x == 4) return 1;
      return 3*f(((2*x+2)%11)-1);
  }
  
  
  int q(int x){
      if(x == 7) return 1;
      return f(x) + q((3*x)%MOD);
  }
  
  int g(int x){
      if(x == 0) return 1;
      return (g(x-1)+f(g(x-1)) + f(x-1) + h(x-1))%MOD;
  }
  
  int h(int x){
      if(x == 0) return 1;
      return (2*h(x-1) + g(x-1) + q(f(x-1)%10))%MOD;
  }
  
  
  int main() {
  
      cout &lt;&lt; g(4);
  
      return 0;
  }
  </code></pre>
  
  <p>The error is that in the function <code>g(x)</code> , it is accessing <code>h(x)</code> which is declared below and <code>h(x)</code> function is using <code>g(x)</code> function so not able to do anything </p>
  
  <p>Please let me know what should I do to make this work.</p>
  
  <p>Thanks a lot.</p>