I am getting an error in code blocks as conflicting types for func. I just want to know what I am doing wrong here in defining the function : <p>i am getting an error as implicit declaration of func in the line containing x=func(n).    </p>

<pre><code>#include&lt;stdio.h&gt;

void main()
{
    long n,x;
    scanf("%ld",&amp;n);
    x=func(n);
    printf("\n %ld",x);
}

long func(long x)
{  
     // function that returns a long value
}
</code></pre>
