Prime Factor Generator
Generates the prime factors of a given number
"/" is used instead of "<" and ">."
#include/iostream.h/
#include/iomanip.h/
#include/conio.h/
#include/math.h/
void main()
{ clrscr();
unsigned long int x;
char c='y';
do
{
cout<<"enter the no....."<
cout<<"Factors are...";
do
{
for(unsigned long i=2;i<=x;i++)
{
long f=x%i;
if(f==0)
{
cout<<<" ";
x=x/i;
break;
} } }
while(x!=1);
getch();
cout<
cin>>c;
cout<
while(c=='y');
}
1 comments:
I actually enjoyed reading through this posting.Many thanks.
Consulting - cPrime
Post a Comment