title: The following code needs manipulations with the same number of code lines
body: <p>The following code is used to find the average of the marks of students of a class, but unfortunately, the code shows 2nd as 2th and 3rd as 3th too, so I've been struggling to get the code right with the same number of code lines</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
  int marks[10],sum=0,i;
  float avg;
  
  for(i=0;i&lt;=9;i++)
  {
  printf("Enter the next element to be inserted into the array\n");
  scanf("%d",&amp;marks[i]);
  }
  
  for(i=0;i&lt;=9;i++)
  {
  sum = sum+marks[i];
  printf("mark %dth=%d\nsum=%d\n",i,marks[i],sum);
  }
  
  avg = sum/10;
  
  printf("The average of the 10 elements of the array is %f",avg);
  
  }
  </code></pre>
  
  <p>How can we make the code print 2th as 2nd and 3th as 3rd while still keeping most of the code unchanged?</p>