title: Calling function x from within function y and vice versa in the same program
body: <pre><code>int right(int n)
  {
          if(n&gt;0)
          {
              n--;
              top_lim ++;
              cout&lt;&lt;"R";
              right_lim--;
              if(right_lim &lt; size)
              return(right(n-1));
              if(top_lim&gt;0)
  --&gt;            return(up(n - 1));
          }
          else
          {
              return 0;
          }
  
  }
  int up(int n)
  {
  if(n&gt;1)
          {
              n--;
              top_lim --;
              cout&lt;&lt;"U";
              if(right_lim &lt; size)
              return(right(n-1));
              if(top_lim &gt; 0 )
              return(up(n-1));
          }
          else
          {
              return 0;
          }
  }
  
  error: [17] 'up' was not declared in this scope|--&gt; indicates error in code ..
  </code></pre>
  
  <p>Description of problem:</p>
  
  <p>The problem is to find all the possible number of paths in a n*n grid in the portion below the diagonal starting from (0,0) to (n,n)
  I basically call the right function first in the main function and then it should print me all paths.</p>
  
  <p>Is there a workaround for this?</p>