When I'm calling a function
f=fact(a) then error message is showing up "Extra parameter in call to fact()
Here is the code:
f=fact(a) then error message is showing up "Extra parameter in call to fact()
Here is the code:
Code:
#include <stdio.h>
#include <conio.h>
void main ()
{
int a;
long f,fact();
clrscr();
printf ("\n Enter a Number : ");
scanf ("%d",&a);
f=fact(a);
printf ("\n The Factorial of %d is : %ld",a,f);
getch();
}
long fact(int b)
{
int i;
long f=1;
for (i=1;i<=b;i++)
f=f*i;
return(f);
}
Comment