Skip to content

Instantly share code, notes, and snippets.

@SohanChy
Created July 26, 2015 16:59
Show Gist options
  • Save SohanChy/a88cf6ff120443a93f75 to your computer and use it in GitHub Desktop.
Save SohanChy/a88cf6ff120443a93f75 to your computer and use it in GitHub Desktop.
Prime Factorial of Any Number entered using recursion
#include <stdio.h>
void pfact(int n);
int main()
{
pfact(147);
return 0;
}
void pfact(int n)
{
int div = 2;
while(n>1)
{
if(n%div !=0)
{
div++;
}
else
{
printf(" %d",div);
pfact(n/div);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment