#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n, x, m;
cout<<"Enter any number : ";
cin>>n;
cout<<"Prime factors : \n";
m=n;
for(int i=2; i<=n/2;)
{
x=m%i;
if(x==0)
{
cout<<i<<"\n";
m=m/i;
}
else
i=++i;
}
getch();
No comments:
Post a Comment