title: How to add f1, f2 and f3 (three outputs of tree void functions) in the main function?
body: <pre><code>#include &lt;iostream&gt;
  #include&lt;cmath&gt;
  
  
  
  using namespace std;
  
      class solution
      {
      float x;
  
      public:
          void quad_f();
          void cube_f();
          void bi_quad_f();
  
      };
  
      void solution::quad_f()
      {
                  float f1;
                  cout &lt;&lt; "Enter the value of x:" &lt;&lt; endl;
                  cin &gt;&gt; x;
                  f1 = 4*pow(x,2) + 3*x + 1;
                  cout &lt;&lt; f1 &lt;&lt; endl;
  
      }
  
      void solution::cube_f()
  
      {
                  cout &lt;&lt; "Enter the value of x:" &lt;&lt; endl;
                  cin &gt;&gt; x;
                  float f2 = pow(x,3) + 1;
                  cout &lt;&lt; f2 &lt;&lt; endl;
  
      }
  
      void solution::bi_quad_f()
  
      {
                  cout &lt;&lt; "Enter the value of x:" &lt;&lt; endl;
                  cin &gt;&gt; x;
                  float f3 = pow(x,4);
                  cout &lt;&lt; f3 &lt;&lt; endl;
      }
  
      int main()
      {
         solution collector;
  
         collector.quad_f();
         collector.cube_f();
         collector.bi_quad_f();
  
  
  
          return 0;
      }
  </code></pre>
  
  <p>I have declared three functions in a class and defined them one-by-one
  to get final output. now i am able to get each out put separately.
  But, i want to add f1, f2 and f3 from above three functions in below
  main functions to get a single output.</p>