title: How to calculate the 2's Compliment of a decimal or Hex number?
body: <p>How to calculate the 2's Compliment of a decimal or Hex number  in C#, In BCL is there any inbuilt function is available,  I have something but not working ,what is the wrong with the given code</p>
  
  <pre><code>var number = 3092;
  var onceC = ~number;
  var twoC = onceC + 1;
  </code></pre>