Skip to content

Instantly share code, notes, and snippets.

@jagdish4501
Created May 10, 2021 08:40
Show Gist options
  • Save jagdish4501/95567648459f40d2d51d37143f685434 to your computer and use it in GitHub Desktop.
Save jagdish4501/95567648459f40d2d51d37143f685434 to your computer and use it in GitHub Desktop.
Let us c Q.
/* using recursion*/
#include <stdio.h>
void prime(int);
int main()
{
int num;
printf(" Enter a number ");
scanf("%d", &num);
prime(num);
}
void prime(int num)
{
for (int a = 2; a <= num; a++)
{
if (num % a == 0)
{
printf("%d,", a);
prime(num / a);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment