error : too few arguments to function? : <p>I did the exact same thing in another part of code and got no error or any problem with it's way of working but in this part and so it gives me an error.
So the function is;</p>

<pre><code>void triangle(int height,int base)
{
   printf("Enter the base of the triangle:");
   scanf("%d",&amp;base);
   printf("\nEnter the height of the triangle:");
   scanf("%d",&amp;height);
   int area;
   area = (height*base)/2;
   printf("\nTriangles area is %d.",area);
}
</code></pre>

<p>I'm using a switch-case function for my code and this is how I call it in main function;</p>

<pre><code>case 3:
     {
         triangle(area);
     }
</code></pre>

<p>Feels weird but this works perfectly;</p>

<pre><code>void square(int length)
{
printf("Enter the length of square:");
scanf("%d",&amp;length);
int area;
area = length*length;
printf("\nRectangles area is %d.",area);
}
</code></pre>

<p>Like this;</p>

<pre><code>case 1:
        {
            square(area);
        }
</code></pre>
