title: remainder (%) operator c#
body: <p>It's a very basic question, I would just like to understand a little better how this operator actually works. </p>
  
  <p>This code is taking a number from the user and then getting the sum of the individual digits:</p>
  
  <pre><code>Console.WriteLine("Please enter a number: ");
  int number = Convert.ToInt32(Console.ReadLine());
  int sum = 0;
  
  while (number / 10 &gt; 0)
  {
      ***sum += number % 10;***
      number = number / 10;
  }
  
  sum += number;
  Console.WriteLine("{0}{1}", "Sum of digits is: ", sum.ToString());
  Console.ReadKey();`
  sum += number % 10;
  </code></pre>
  
  <p>The way I'm interpreting it is that because sum = 0, it basically takes the number, divides it by 10 and then assigns the remainder of that to the sum?</p>
  
  <p>Is this right or have I misunderstood it?</p>
  
  <p>Thanks in advance for any help</p>