title: Calculations with loops
body: <p>I'm trying to create a program whereby it will display a (5 digit integer).<br>
  An example would be if a user entered "23456", it will output "2 3 4 5 6".</p>
  
  <p>I'm only allowed to capture the input(scanf) with integer(%d). I managed to do it without a for/while loop. </p>
  
  <pre><code>fivedigit = num / 10000; 
  fivedigitr = num % 10000; 
  fourdigit = fivedigitr / 1000; 
  fourdigitr = fivedigitr % 1000;
  threedigit = fourdigitr / 100;
  threedigitr = fourdigitr % 100;
  twodigit = threedigitr / 10;
  twodigitr = threedigitr % 10;
  onedigit = twodigitr / 1;
  onedigitr = twodigitr % 1 
  printf("%d %d %d %d %d\n", fivedigit,fourdigit,threedigit, twodigit, onedigit);
  </code></pre>
  
  <p>However, right now I'm needed to create a Version 2 using a loop. I'm unsure of how to cut the calculations short as to reduce the redundancy. The only thing that I managed to figure out is to reduce the "10000" by dividing by 10.</p>
  
  <pre><code>for(i=0; i&lt;5; i++){
  fivedigit = num / division2;
  fivedigitr = num % division2;
  division2 = division2/10; 
  }
  </code></pre>
  
  <p>Any help would be appreciated. I just need to know the basic ways on how to reduce the redundancy and I can move on from there and figure out.</p>
  
  <p>Thanks.</p>