title: Inputting numbers in char array
body: <p>In reference to this <a href="http://www.spoj.com/problems/JULKA/" rel="nofollow">problem</a> I need to input a 100 digit number in the program and perform operations on it. I figured I would use a char array to do it.</p>
  
  <p>I wrote this code after trying for some time.</p>
  
  <pre><code> int main()
   {
   //int cases=10;
  
  //while(cases--)
  //{
      int i;
      char totalapples[102];
      //char klaudia_apples[200] , natalia_apples[200];
  
      for(i=0;totalapples[i]!='\0';i++)
      {
              cin&gt;&gt;totalapples[i];
      }
  
      //cin&gt;&gt;moreapples[200];
      //cout&lt;&lt;moreapples[200];
  
      while(i--)
      {
        cout&lt;&lt;totalapples[i];
      }
  //}
  
      return 0;
    }
  </code></pre>
  
  <p>When I run this, I get the following result:</p>
  
  <pre><code>Input : 1234657891234567981345698
  Output : 987564321
  </code></pre>
  
  <p>Can anybody tell what is happening??</p>