title: How to return a value to another function
body: <p>I cannot seem to figure out how to make this work any help would be greatly appreciated as i have been trying for days :(</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;math.h&gt;
  
  using namespace std;
  
  int input;
  int sum;
  int number1;
  int number2;
  int number3;
  
  void isArmstrong (int input, int sum)
  {
      if (input == sum)
          cout &lt;&lt; input &lt;&lt; " is an Armstrong number" &lt;&lt; endl;
  
      if (input != sum)
          cout &lt;&lt; input &lt;&lt; " is not an Armstrong number" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>cubeOfDigits does not return input and sum to isArmstrong, (return input,sum) error is as follows: expression result unused [-Wunused-value]</p>
  
  <pre><code>int cubeOfDigits (int input, int sum, int number1, int number2, int number3)
  {
      cout &lt;&lt; "Enter an integer between 0-999" &lt;&lt; endl;
      cin &gt;&gt; input;
  
      number1 = input / 100;
      number2 = input % 100;
      number3 = number2 % 10;
  
      sum = pow(number1, 3) + pow(number2, 3) + pow(number3, 3);
  
      isArmstrong(input, sum);
  
      return input,sum;
  }
  </code></pre>
  
  <p>main calls cubeOfDigits</p>
  
  <pre><code>int main(void)
  {
      cout &lt;&lt; "Welcome" &lt;&lt; endl;
  
      cubeOfDigits(input, sum, number1, number2, number3);
  
      return 0;
  }
  </code></pre>