title: How to execute all statement except one based on some condition?
body: <p>Let's say I have a method in which there are <strong>multiple statements which will be executed when methods call except one</strong>. (one statement which will not be executed will be decided based on parameter passed to the method).</p>
  
  <p>how can I achieve above scenario?</p>
  
  <p>Things I have done so far.</p>
  
  <p>I have following method.</p>
  
  <pre><code>enum Abc
  {
      A = 0,
      B = 1,
      C = 2,
      D = 3,
      E = 4,
  }
  int GetSum(Abc abc)
  {
      int sum = 0;
      if(abc != Abc.A)
      {
          sum += 23;
      }
      if(abc != Abc.B)
      {
          sum += 68;
      }
      if(abc != Abc.C)
      {
          sum += 96;
      }
      if(abc != Abc.D)
      {
          sum += 57;
      }
      if(abc != Abc.E)
      {
          sum += 63;
      }
      return sum;
  }
  </code></pre>
  
  <p>Here before adding value to <code>sum</code> I am checking whether I have to add or not based on the value of <code>abc</code>. </p>
  
  <p>Basically, I want that if value of <code>abc</code> is <code>Abc.A</code> then execute all the statement except <code>sum += 23;</code>.</p>
  
  <p>In my code there are too many if conditions. Is there way to do things with less if statement or any other way(better)?</p>
  
  <p><strong>Note:-</strong> Here <code>sum += //something</code> is just one of the statements, and it is not necessary that the statement is addition only (it will be anything).</p>