how to get the prime factor a a given number?

please post your reply,
My solution would be to write a short program to calculate it.
If you want to learn how to do this, please post details of your attempt and specific problems and someone will give you some help in compleating it.
dear sir,
hope following loop will solve your problem

int num,i;
for(i<1;i<=num;i++)
{
if(num%i==0)
cout<<i<<"\n";
}
With Regards,
Matanuragi
Last edited on
Matanuragi,

1. Please don't post code for people who have not even attempted to write the program themselves.

2. Your code has quite a few errors in it. It would be smart to check your code before you post it as an answer.
Topic archived. No new replies allowed.