title: Functions with similar parameter but have different outputs
body: <p>I have to write multiple functions that have similar parameters. Is there a way to make it shorter and readable?
  Here is an example code</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  void test1(int index){
      std::cout &lt;&lt; &quot;Chosen Answer : &quot; &lt;&lt; index &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;ABCD &quot;;
  }
  
  void test2(int index){
      std::cout &lt;&lt; &quot;Chosen Answer : &quot; &lt;&lt; index &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;JKLM &quot;;
  }
  
  void test3(int index){
      std::cout &lt;&lt; &quot;Chosen Answer : &quot; &lt;&lt; index &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;PQRS &quot;;
  }
  
  int main() {
      std::vector&lt;int&gt; input;
      for(int i=0; i&lt;5; i++){
          input.push_back(i);
      }
      
      test1(input[1]);
      test2(input[2]);
      test3(input[3]);
      
      return 0;
      
  }
  </code></pre>