#include<stdio.h>
#include<conio.h>
void prime(int num)
{
int i=2;
if(num==1)
return;
while(num%i!=0)
++i;
printf("%d ",i);
prime(num/i);
}
void main()
{
int num;
clrscr();
printf("Enter Any Number : ");
scanf("%d",&num);
printf("\n\nPrime Factors %d = ",num);
prime(num);
getch();
}
#include<conio.h>
void prime(int num)
{
int i=2;
if(num==1)
return;
while(num%i!=0)
++i;
printf("%d ",i);
prime(num/i);
}
void main()
{
int num;
clrscr();
printf("Enter Any Number : ");
scanf("%d",&num);
printf("\n\nPrime Factors %d = ",num);
prime(num);
getch();
}
0 comments:
Post a Comment