title: How do I check the validity of the Canadian Social Insurance Number in C#?
body: <p>I've been given the assignment to write an algorithm in C# that checks the validity of a Canadian Social Insurance Number (SIN). Here are the steps to validate a SIN.</p>
  
  <p>Given an example Number: <code>123 456 782</code></p>
  
  <ol><li>Remove the check digit (the last digit):  12345678<b>2</b>
  
  <li>Extract the even digits (2,4,6,8th digith):  1<b>2</b>3<b>4</b>5<b>6</b>7<b>8</b>
  
  <li>Double them: 
  
  
  <pre>
      2  4  6  8
      |  |  |  |
      v  v  v  v
      4  8  12 16 
  </pre>
  
  <li>Add the digits together: <pre>4+8+1+2+1+6 = 22</pre>
  
  <li>Add the Odd placed digits:<pre>    1+3+5+7 = 16</pre>
  
                             <pre>      Total : 38</pre>
  </ol>
  
  <p><strong>Validity Algorithm</strong></p>
  
  <ol>
  <li>If the total is a multiple of 10, the check digit should be zero.  </li>
  <li>Otherwise, Subtract the Total from the next highest multiple of 10 (40 in this case)</li>
  <li>The check digit for this SIN must be equal to the difference of the number  and the totals from earlier (in this case, <code>40-38 = 2</code>; check digit is 2, so the number is valid) </li>
  </ol>
  
  <p>I'm lost on how to actually implement this in C#, how do I do this?</p>