error recursive function in c
hi,
This is a recursive function code:
#include <stdio.h>
main()
{
int a, fact;
printf("\nEnter any number\n");
scanf("%d",&a);
fact=rec(a);
printf(" Factorial value of %d is %d\n",a,fact);
}
rec(x)
int x;
{
int f;
if(x==1)
retrun(1);
else
f=x*rec(x-1);
return(f);
}
and this is the compiling error:
[root@localhost lbin]# gcc -o l152 l152.c
/root/tmp/ccGiALkv.o(.text+0x6f): In function `rec':
: undefined reference to `retrun'
collect2: ld returned 1 exit status
plz tell me where is the error and is there any deference for dos and linux enviroments?
|