title: Convert from 24 to 12 hour format
body: <p>I am doing a simple conversion program and am getting a lot of errors I don't really understand. Here is my code that I have done so far. I use visual Studio 2019 and these are all the messages I get for the errors. </p>
  
  <pre class="lang-none prettyprint-override"><code> error C2062: type 'char' unexpected
   error C2182: 'input': illegal use of type 'void'
   error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
   message : The initializer contains too many elements
   error C2065: 'AMPM': undeclared identifier
   error C2182: 'convert': illegal use of type 'void'
   error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
  message : The initializer contains too many elements
  1&gt; error C2065: 'AMPM': undeclared identifier
  : error C2182: 'output': illegal use of type 'void'
  1&gt;C:\Users\hp\source\repos\Project5\Project5\Source.cpp(17,31): error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
  : message : The initializer contains too many elements
  : error C2065: 'choice': undeclared identifier
  : error C2065: 'choice': undeclared identifier
  : error C2065: 'choice': undeclared identifier
  1&gt;Done building project "Project5.vcxproj" -- FAILED.
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  
  using namespace std;
  
  void input(int&amp; hours24, int&amp; minutes);
  void convert(int&amp; hours, char&amp; AMPM);
  void output(int hours, int minutes, char AMPM);
  
  int main() {
      cout &lt;&lt; "-----------------------------Convert from 24-hour format to 12 hour format--------------------\n";
      int hour, min,
          char choice, AMPM;
      do {
          void input(hour, min);
          void convert(hour, min, AMPM);
          void output(hour, min, AMPM);
          cout &lt;&lt; "/n";
          cout &lt;&lt; "To complete press y or Y: "; cin &gt;&gt; choice;
      } while (choice == 'Y' || choice == 'y');
  }
  
  void input(int&amp; hours24, int&amp; minutes) {
      cout &lt;&lt; "Enter your time in hours and minutes"; cin &gt;&gt; hours24; cin &gt;&gt; minutes;
  }
  
  void convert(int&amp; hours, char&amp; type) {
      if (hours &gt; 12) {
          hours -= 12;
          type = 'P';
      }
      else {
          type = 'A';
      }
  }
  
  void output(int hours, int minutes, char type) {
      cout &lt;&lt; "In 12 hour notation: " &lt;&lt; hours &lt;&lt; ":" &lt;&lt; minutes &lt;&lt; " " &lt;&lt; type &lt;&lt; "";
  }
  </code></pre>