title: 'while' Loop in Objective-C
body: <p>The following program calculates and removes the remainder of a number, adds the total of the remainders calculated and displays them.</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  int main (int argc, char * argv[]) {
      @autoreleasepool {
          int number, remainder, total;
          NSLog(@"Enter your number");
          scanf("%i", &amp;number);
  
          while (number != 0)
          {
              remainder = number % 10;
              total += remainder;
              number /= 10;
          }
          NSLog(@"%i", total);    
      }
      return 0;
  }
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>Why is the program set to continue as long as the number is not equal to 0? Shouldn't it continue as the long as the remainder is not equal to 0?</p></li>
  <li><p>At what point is the remainder discarded from the value of <code>number</code>? Why is there no <code>number -= remainder</code> statement before <code>n /=10</code>?</p></li>
  </ol>
  
  <p>[Bonus question: Does Objective-C get any easier to understand?]</p>