title: How to cause an intentional division by zero?
body: <p>For testing reasons I would like to cause a division by zero in my C++ code. I wrote this code:</p>
  
  <pre><code>int x = 9;
  cout &lt;&lt; "int x=" &lt;&lt; x;
  int y = 10/(x-9);
  y += 10;
  </code></pre>
  
  <p>I see "int =9" printed on the screen, but the application doesn't crash. Is it because of some compiler optimizations (I compile with gcc)? What could be the reason?</p>