Optimise/modify as you like, and oh tell me the system that you'll use too(other than this)
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
long rec(long s)
{
long i;
if (s==0){ cout<<"0"<<endl; return 0; }
for (i=2;i<=(s/2);i++)
{
if (s % i == 0)
{
cout<<i<<endl;
s=s/i;
i=2;
}
}
cout<<s<<endl;
}
int main()
{
long a;
bool t;
char l;
cout<<"Enter a number to find prime factors : ";
cin>>a;
rec(a);
t=1;
while (t=1)
{
cout<<"again? (y/n)"<<endl;
cin>>l;
if (l=='n')
{
t=0;
break;
}
else if (l=='y')
{
cout<<"Enter a number to find prime factors : ";
cin>>a;
rec(a);
}
}
}

But goes wrong with Float values no ?? 

Again 3k එනව 