title: What happens if an exception occurs in Catch block in C#. Also what would be the caller result in that case
body: <p>It was an interview question, quite simple, but I am not confident about the answer.</p>
  
  <p>What happens if an exception occurs in catch block ? </p>
  
  <p>I am trying to give an example small prog of what the interviewer was trying to ask me, please correct my program if it is not compiling, I am really new to this. Bottom line is what happens if an exception occurs in Catch and what will be the value of caller int hat case.</p>
  
  <p>For instance, I have the following:</p>
  
  <pre><code>double Calculate(int x)
  {
      try
      {
          x = x/2;
      }
      catch(Exception ex)
      {
          Console.Writeline("Message: "+ ex.Message);
      }
      finally
      {
        x = 10;
      }
      return x;
  }
  
  double myResult = Calculate(x); //x can be any number or 0 for example
  </code></pre>
  
  <p>Now there are two questions:</p>
  
  <ol>
  <li><p>What happens if an exception happens in catch block ? Also, how to resolve it ? (This is simple example of what the interviewer was asking a similar question). </p></li>
  <li><p>What will happen to myResult if an exception happens in Calculate(x) method ?What will be its value in all cases ? (Please explain every case with an example) </p></li>
  </ol>
  
  <p>I would like to understand this with a detailed explanation too.</p>
  
  <p>Thank you so much.</p>