title: Pass-by-value vs pass-by-reference vs pass-by-value-result
body: <h3>I've got this question, and I'm a bit confused as to what would be printed, especially for pass-by-reference. What value would be passed to x if there are two parameters? Thanks!</h3>
  <p>Consider the following program. For each of the following parameter-passing methods, what is printed?</p>
  <p>a.  Passed by value</p>
  <p>b.  Passed by reference</p>
  <p>c.  Passed by value-result</p>
  <pre><code>void main()
  {
      int x = 5;
      foo (x,x);
      print (x);      
  }
  
  void foo (int a, int b)
  {
      a = 2 * b + 1;
      b = a - 1;      
      a = 3 * a - b;
  }
  </code></pre>