Hi all,
I have written a code for a program which detects whether a number is a factorial number or not. I am getting a linker error saying "undefined reference to WinMain@16" after compilation
of my program. Kindly help me to solve this problem. Thank you. Below is my code:
Code:#include<stdio.h>
int main()
{
int i,n,prod=1;
printf("Enter n to be checked");
scanf("%d",&n);
if(n==1 || n==2)
{
printf("n is a factorial number");
}
else if(n>2)
{
for(i=1;i<=n/2;)
{
while (prod<=n)
{
prod*=i;
i++;
}
}
}
if(prod==n)
{
printf("factorial");
}
else
printf("not factorial");
system("pause");
return(0);
}

