Hey Guys,
Can any body help me out with the factorial problem below. I learnt scheme last semester and I am trying to use the same approach to find the factorial using recursion but it doesn't seem to work !
Code:int main() { int n; printf("Enter a number for factorial :"); scanf("%d", &n); factorial(n); } int factorial(int num){ double ans =0; int print_factorial(int num) { if (num==0) return 1; else ans = (num*print_factorial(num-1)); } printf("%d",ans); }