title: How can I omit a "Cout" statement for a specific "if-else" statement?
body: <p><a href="https://i.stack.imgur.com/Zlm6C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zlm6C.png" alt="image"></a></p>
  
  <p>I'm trying to avoid a <code>cout</code> statement. Specifically,</p>
  
  <pre><code>cout&lt;&lt; "Enter integer 2: \n"
  
  cin&gt;&gt; i
  </code></pre>
  
  <p>I've tried utilizing the <code>cin.ignore(j)</code> in various places of the 8th if-else statement. That is, <strong>option 8</strong> from the user selections.</p>
  
  <p>I want to accomplish this with the last complicated method. I'm in "Introduction to C++" and well, I'm not too familiar with advanced methods. </p>
  
  <p>The goal here is to create a calculator with the given functions under the prototype section. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;math.h&gt;
  using namespace std;
  
  int menu();
  int addition (int a, int b);
  int subtract (int a, int b);
  int multiply (int a, int b)
  int division (int a, int b);
  double realDivision (double a, double b);
  double quotient (double a, double b);
  double remainder (double a, double b);
  int factorial (int a);
  
  int main(int argc, const char * argv[])
  {
      int choice, i, j;
      choice = menu();
  
      if (choice == 0)
          return 0;
  
      cout &lt;&lt; "Enter integer 1: \n";
      cin &gt;&gt; i;
  
      cout &lt;&lt; "Enter integer 2: \n";
      cin &gt;&gt; j;
  
      if (choice == 1)
          cout &lt;&lt; addition(i, j) &lt;&lt; endl;
  
      else if (choice == 2)
          cout &lt;&lt; subtract(i, j) &lt;&lt; endl;
  
      else if (choice == 3)
          cout &lt;&lt; multiply(i, j) &lt;&lt; endl;
  
      else if (choice == 4)
          cout &lt;&lt; division(i, j) &lt;&lt; endl;
  
      else if (choice == 5)
          cout &lt;&lt; realDivision(i, j) &lt;&lt; endl;
  
      else if (choice == 6)
          cout &lt;&lt; quotient(i, j) &lt;&lt; endl;
  
      else if (choice == 7)
          cout &lt;&lt; remainder(i, j) &lt;&lt; endl;
  
      else if (choice == 8)
          cout &lt;&lt; i &lt;&lt; ", factorial = " &lt;&lt; factorial(i) &lt;&lt; endl;
  
          return 0;
       }
  
  int menu()
  {
    int choice = 10;
     while ((choice &gt; 9) || (choice &lt; 0))
     {     
       cout &lt;&lt; "Enter 0 to quit\n";
       cout &lt;&lt; "Enter 1 for addition\n";
       cout &lt;&lt; "Enter 2 for subtraction\n";
       cout &lt;&lt; "Enter 3 for Multiplication\n";
       cout &lt;&lt; "Enter 4 for Division of two integers\n";
       cout &lt;&lt; "Enter 5 for Real Division of two integers\n"    
       cout &lt;&lt; "Enter 6 for Quotient of a division\n";
       cout &lt;&lt; "Enter 7 for Remainder of a division\n";
       cout &lt;&lt; "Enter 8 for Factorial of an integer\n";
       cout &lt;&lt; "Enter 9 for Exponential of two integers\n";
       cin &gt;&gt; choice;
  
     }
      return choice;
  }
  
  int addition(int a, int b)
  {
      return(a+b);
  }
  
  int subtract(int a, int b)
  {
      return(a-b);
  }
  
  int multiply(int a, int b)
  {
      return (a * b);
  }
  
  int division(int a, int b)
  {
      return a/b;
  }
  
  double realDivision(double a, double b)
  {
      return(a/b);
  }
  
  double quotient(double a, double b)
  {
      return(a/b);
  }
  
  double remainder(double a, double b)
  {
      return(a/b);
  }
  
  int factorial(int a)
  {
      int product = 1;
      while (a &gt; 1)
      {
          product *=a;
          a--;
      }
      return product;
  }
  </code></pre>