title: How do I print out a sequence of answers using a for loop in C?
body: <p>The question might be a little vague still so allow me to elaborate. My goal is to calculate download speeds based on user input. So a sample output is shown <a href="http://i.stack.imgur.com/ptkcO.png" rel="nofollow">here</a>.</p>
  
  <p>So I've gone ahead and asked for user input using the following code (this part totally works but just to give you the bigger picture) </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
  
  int minFileSize, maxFileSize, maxDLSpeed, minDLSpeed;
  int time;
  
  
  //first we get user input for minimum size and download speeds
  printf("Enter a minimum file size: ");
  scanf("%d", &amp;minFileSize);
  //after this condition is satisfied..
  while (minFileSize &lt;= 0 ) {
      printf("Invalid input. Try again: \n");
      scanf("%d", &amp;minFileSize);
  
      while(getchar() != '\n' );                        //clears caches
  }
  //program continues
  printf("Enter a minimum download speed (MB/s): ");
  scanf("%d", &amp;minDLSpeed);
  while (minDLSpeed &lt;= 0) {
      printf("Invalid input. Try again: ");
      scanf("%d", &amp;minDLSpeed);
  
      while ( getchar() != '\n' );
  }
  printf("Enter a maximum file size (MB): ");
  scanf("%d", &amp;maxFileSize);
  while (maxFileSize &lt; minFileSize) {                   //maxFileSize can't be lower than minFileSize
      printf("Invalid input. Try again: ");
      scanf("%d", &amp;maxFileSize);
  
      while (getchar() != '\n');
  }
  printf("Enter maximum download speed (MB/s): ");
  scanf("%d", &amp;maxDLSpeed);
  while (maxDLSpeed &lt; minDLSpeed) {
      printf("Invalid input. Try again: ");
      scanf("%d", &amp;maxDLSpeed);
  
      while (getchar() != '\n');
  }
  </code></pre>
  
  <p>where the while (getchar() != '\n') just clears the cache so we can proceed to the next input. </p>
  
  <p>After getting the user input, I then use a nested for-loop to loop through the minimum file size all the way to the maximum size (so it stops when it reaches the maximum size, which is based on what the user enters) and then do the same thing for the minimum download speed and maximum download speed. <strong>Then each time the loop iterates, its supposed to output the download speed, which is (file size / download speed) So i/j represents this</strong></p>
  
  <p>Here's the loop I used for that </p>
  
  <pre><code>for (int i = minFileSize; i &lt;= maxFileSize; i++)
  {
      for (int j = minDLSpeed; j&lt;= maxDLSpeed; j++) {
  
          time = i / j;     
      };
  }
  </code></pre>
  
  <p><em>Phew</em> If you've read that far, thank you! Now my question is how do I print the output in the format that I showed above, so that each time the loop runs, it prints out the correct download speed based on the file size and download speed.</p>