title: wanted to know about ~tilde operator?
body: <p>I have seen many sites and referred books and reach to a point that tilde(~) operator is used to do ones' complement but when i ran the following code snippet ,i got amazed by its output.Can anybody explain me the output ??</p>
  
  <p>The output  coming is <strong>-11</strong> for the following code.
  Any help will be appreciated.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main() {
      int x=10;
      cout&lt;&lt;~x;
      return 0;
  }
  </code></pre>