title: Output 2 Values One Line In For Loop - C
body: <p>I have a For loop in a function as follows:</p>
  
  <pre><code>int fnSearch(int arnSalaries [10][2], int nSalary, char cFound)
  {
      int nRow, nCol;
  
      printf("Please enter the Salary to find the Employee ID : ");
      scanf("%d", &amp;nSalary);
  
      for(nRow = 0; nRow &lt; 10; nRow++)
      {
          if(nSalary == arnSalaries[nRow][1])
          {
              printf("\%d found - Employee ID matching that salary is: %d\n", 
                  nSalary, arnSalaries[nRow][0]);
              cFound = 'Y';
              //nRow = 10; /* This is to break out of the loop */
          }
      }
  
      if(cFound == 'N')
      {
          printf("Sorry, that salary does not match an employee\n");
      }
  
      return cFound;
  }
  </code></pre>
  
  <p>When i type in a salary such as "10000", the output is as follows:</p>
  
  <pre><code>10000 found - Employee ID matching that salary is: 21
  10000 found - Employee ID matching that salary is: 23
  </code></pre>
  
  <p>How can i change the code so it displays something like the following:</p>
  
  <pre><code>10000 found - Employee ID(s) matching that salary is/are: 21, 23
  </code></pre>
  
  <p>EDIT:
  I am not looking for any code to be written - just a hint in the right direction as to what i should be looking at to solve this issue</p>