I need help with recursion function.
It prints all the prime factors of an input number.
My question is how to modify function so that START-GOTO is replaced by a loop?
Here is the code:
int f(int n,int i)
{
start:
if(n==1)
goto start;
if(n % i == 0)
{
printf("%d",i);
return f(n/i,i);
}
else
{
return f(n,i+1);
}
}
Thanks for replies.