Compiler error: Variable or field declared void
<p>I get some error when i try to run this, could someone please tell me the mistakes?</p>

<blockquote>
  <p>[error: C:\Users\Ethan\Desktop\Untitled1.cpp In function `int main()':</p>
  
  <p>25 C:\Users\Ethan\Desktop\Untitled1.cpp variable or field
  `findfactors' declared void</p>
  
  <p>25 C:\Users\Ethan\Desktop\Untitled1.cpp initializer expression list
  treated as compound expression]</p>
</blockquote>

<p>Here is the code :</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;cmath&gt;
using namespace std;

void prompt(int&amp;, int&amp;, int&amp;);
int gcd(int , int , int );//3 input, 3 output
void findfactors(int , int , int, int, int&amp;, int&amp;);//3 input, 2 output
void display(int, int, int, int, int);//5 inputs

int main()
{
int a, b, c; //The coefficients of the quadratic polynomial
int ag, bg, cg;//value of a, b, c after factor out gcd
int f1, f2; //The two factors of a*c which add to be b
int g; //The gcd of a, b, c

prompt(a, b, c);//Call the prompt function

g=gcd(a, b, c);//Calculation of g

void findfactors(a, b, c, f1, f2);//Call findFactors on factored polynomial

display(g, f1, f2, a, c);//Call display function to display the factored polynomial

system("PAUSE");
return 0;
}

void prompt(int&amp; num1, int&amp; num2, int&amp; num3) //gets 3 ints from the user
{
    cout &lt;&lt; "This program factors polynomials of the form ax^2+bx+c."&lt;&lt;endl;
    while(num1==0)
    {
        cout &lt;&lt; "Enter a value for a: ";
        cin &gt;&gt; num1;
        if(num1==0)
        {
            cout&lt;&lt; "a must be non-zero."&lt;&lt;endl;
        }
    }

    while(num2==0 &amp;&amp; num3==0)
    {
        cout &lt;&lt; "Enter a value for b: ";
        cin &gt;&gt; num2;
        cout &lt;&lt; "Enter a value for c: ";
        cin &gt;&gt; num3;
        if(num2==0 &amp;&amp; num3==0)
        {
            cout&lt;&lt; "b and c cannot both be 0."&lt;&lt;endl;
        }
    }
}

int gcd(int num1, int num2, int num3)
{
int k=2, gcd=1;
while (k&lt;=num1 &amp;&amp; k&lt;=num2 &amp;&amp; k&lt;=num3)
{
    if (num1%k==0 &amp;&amp; num2%k==0 &amp;&amp; num3%k==0)
        gcd=k;
    k++;
}

return gcd;
}

void findFactors(int Ag, int Bg, int Cg,int&amp; F1, int&amp; F2)
{
int y=Ag*Cg;
int z=sqrt(abs(y));

for(int i=-z; i&lt;=z; i++) //from -sqrt(|y|) to sqrt(|y|)
{
    if(i==0)i++; //skips 0

    if(y%i==0) //if i is a factor of y
    {
        if(i+y/i==Bg) //if i and its partner add to be b
            F1=i, F2=y/i;
        else
            F1=0, F2=0;
    }
}
}

void display(int G, int factor1, int factor2, int A, int C)
{
int k=2, gcd1=1;
while (k&lt;=A &amp;&amp; k&lt;=factor1)
{
    if (A%k==0 &amp;&amp; factor1%k==0)
        gcd1=k;
    k++;
}

int t=2, gcd2=1;
while (t&lt;=factor2 &amp;&amp; t&lt;=C)
{
    if (C%t==0 &amp;&amp; factor2%t==0)
        gcd2=t;
    t++;
}
cout&lt;&lt;showpos&lt;&lt;G&lt;&lt;"*("&lt;&lt;gcd1&lt;&lt;"x"&lt;&lt;gcd2&lt;&lt;")("&lt;&lt;A/gcd1&lt;&lt;"x"&lt;&lt;C/gcd2&lt;&lt;")"&lt;&lt;endl;
}
</code></pre>
