I created this function and I need help turning this into a recursive function
#include "stdafx.h"
#include "stdio.h"
int fact (int n); // function prototype//
int main (void)
{
int n,result;
printf("please enter a positive integer");
scanf("%d", &n);
result = fact(n);
printf("The answer is %d\n", result);
return 0;
}
int fact(int n)
{
int i, product=1;
for(i=1; i<=n; i++) //algorithm
{
product *= i;
}
return (product);
}
Thanks for the guidance