integer function with no return value : <p>I'm trying to execute the below code, since the function has no return value but it was defined with integer return type. how it was running without any error.</p>

<pre><code>#include &lt;stdio.h&gt;
int fn(int a, int b){
  int temp = b;
  a = 2*temp;
  b = a;
}
int main()
{
  int x,y,printval;
  scanf("%d%d",&amp;x,&amp;y);
  printval = fn(x,y);
  printf("%d", printval);
  return 0;
}
</code></pre>

<p>i Expect the output be error but it was resulting in 40(input:10,20)</p>
